2019-01-14 01:00:34 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-06-19 16:05:32 +00:00
|
|
|
. ${SCRIPTS:-/}start-utils
|
2021-03-11 22:29:21 +00:00
|
|
|
isDebugging && set -x
|
2019-01-14 01:00:34 +00:00
|
|
|
|
|
|
|
if isURL ${CUSTOM_SERVER}; then
|
|
|
|
filename=$(basename ${CUSTOM_SERVER})
|
|
|
|
export SERVER=/data/${filename}
|
|
|
|
|
2019-06-12 18:33:10 +00:00
|
|
|
if [[ -f ${SERVER} ]] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
2020-03-06 15:52:17 +00:00
|
|
|
log "Using previously downloaded jar at ${SERVER}"
|
2019-01-14 01:00:34 +00:00
|
|
|
else
|
2020-03-06 15:52:17 +00:00
|
|
|
log "Downloading custom server jar from ${CUSTOM_SERVER} ..."
|
2019-01-14 01:00:34 +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}"
|
2019-01-14 01:00:34 +00:00
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
elif [[ -f ${CUSTOM_SERVER} ]]; then
|
2020-12-29 16:56:05 +00:00
|
|
|
export SERVER=${CUSTOM_SERVER}
|
|
|
|
|
|
|
|
elif [[ ${GENERIC_PACK} ]]; then
|
|
|
|
log "Using custom server jar from generic pack at ${CUSTOM_SERVER} ..."
|
2019-01-14 01:00:34 +00:00
|
|
|
export SERVER=${CUSTOM_SERVER}
|
|
|
|
|
|
|
|
else
|
2020-03-06 15:52:17 +00:00
|
|
|
log "CUSTOM_SERVER is not properly set to a URL or existing jar file"
|
2019-01-14 01:00:34 +00:00
|
|
|
exit 2
|
2020-12-29 16:56:05 +00:00
|
|
|
|
2019-01-14 01:00:34 +00:00
|
|
|
fi
|
|
|
|
|
2020-04-21 23:30:48 +00:00
|
|
|
export SKIP_LOG4J_CONFIG=true
|
|
|
|
|
2021-09-16 02:27:48 +00:00
|
|
|
exec ${SCRIPTS:-/}start-setupWorld $@
|