mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2024-06-07 19:40:43 +00:00
45 lines
1.1 KiB
Bash
Executable File
45 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
: "${FORGE_VERSION:=${FORGEVERSION:-RECOMMENDED}}"
|
|
: "${FORGE_FORCE_REINSTALL:=false}}"
|
|
|
|
# shellcheck source=start-utils
|
|
. "${SCRIPTS:-$(dirname "$0")}/start-utils"
|
|
isDebugging && set -x
|
|
|
|
# NOTE: VERSION rather than VANILLA_VERSION is specified to allow for latest supported
|
|
# Forge version to be selected.
|
|
if [[ ${FORGE_INSTALLER} ]]; then
|
|
if ! mc-image-helper install-forge \
|
|
--output-directory=/data \
|
|
--results-file=/data/.run-forge.env \
|
|
--minecraft-version="${VERSION}" \
|
|
--forge-installer="${FORGE_INSTALLER}" \
|
|
--force-reinstall="${FORGE_FORCE_REINSTALL}"; then
|
|
log "ERROR failed to install Forge given installer ${FORGE_INSTALLER}"
|
|
exit 1
|
|
fi
|
|
|
|
else
|
|
if ! mc-image-helper install-forge \
|
|
--output-directory=/data \
|
|
--results-file=/data/.run-forge.env \
|
|
--minecraft-version="${VERSION}" \
|
|
--forge-version="${FORGE_VERSION}" \
|
|
--force-reinstall="${FORGE_FORCE_REINSTALL}"; then
|
|
log "ERROR failed to install Forge"
|
|
exit 1
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
# grab SERVER and export it
|
|
set -a
|
|
source /data/.run-forge.env
|
|
set +a
|
|
|
|
export FAMILY=FORGE
|
|
|
|
exec "${SCRIPTS:-/}start-setupWorld" "$@"
|