docker-minecraft-server/scripts/start-deployCustom

45 lines
1.1 KiB
Plaintext
Raw Normal View History

#!/bin/bash
2023-06-24 16:38:15 +00:00
: "${CUSTOM_SERVER:=}"
: "${GENERIC_PACK:=}"
: "${CUSTOM_JAR_EXEC:=}"
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
isDebugging && set -x
2023-06-24 16:38:15 +00:00
if isURL "${CUSTOM_SERVER}"; then
filename=$(basename "${CUSTOM_SERVER}")
export SERVER=/data/${filename}
if [[ -f ${SERVER} ]] && ! isTrue "$FORCE_REDOWNLOAD"; then
2020-03-06 15:52:17 +00:00
log "Using previously downloaded jar at ${SERVER}"
else
2020-03-06 15:52:17 +00:00
log "Downloading custom server jar from ${CUSTOM_SERVER} ..."
2023-06-24 16:38:15 +00:00
if ! curl -sSL -o "${SERVER}" "${CUSTOM_SERVER}"; then
2020-03-06 15:52:17 +00:00
log "Failed to download from ${CUSTOM_SERVER}"
exit 2
fi
fi
elif [[ -f ${CUSTOM_SERVER} ]]; then
export SERVER=${CUSTOM_SERVER}
elif [[ ${GENERIC_PACK} ]]; then
log "Using custom server jar from generic pack at ${CUSTOM_SERVER} ..."
export SERVER=${CUSTOM_SERVER}
2023-06-24 16:38:15 +00:00
elif [[ ${CUSTOM_JAR_EXEC} ]]; then
log "CUSTOM_JAR_EXEC is in use, so \$SERVER will not be set"
else
2020-03-06 15:52:17 +00:00
log "CUSTOM_SERVER is not properly set to a URL or existing jar file"
exit 2
fi
# Allow for overriding Family on custom for testing.
export FAMILY="${FAMILY:-HYBRID}"
2023-06-24 16:38:15 +00:00
exec "${SCRIPTS:-/}start-setupWorld" "$@"