mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-12-15 14:52:27 +00:00
9a7a532f7b
For #577
32 lines
874 B
Bash
32 lines
874 B
Bash
#!/bin/bash
|
|
|
|
. ${SCRIPTS:-/}start-utils
|
|
set -o pipefail
|
|
set -e
|
|
|
|
latestAsset=$(
|
|
curl -fsSL https://api.github.com/repos/Luohuayu/CatServer/releases/latest | \
|
|
jq '.assets[] | select(.name | match(".*-universal.jar"))'
|
|
)
|
|
|
|
if [[ -z "${latestAsset}" ]]; then
|
|
log "ERROR: latest release of Catserver is missing universal.jar asset"
|
|
exit 1
|
|
fi
|
|
|
|
isDebugging && log "Latest asset ${latestAsset}"
|
|
latestJarName=$(echo ${latestAsset} | jq --raw-output '.name')
|
|
latestJarId=$(echo ${latestAsset} | jq --raw-output '.id')
|
|
|
|
|
|
export SERVER="/data/${latestJarName}"
|
|
|
|
if [ ! -f ${SERVER} ]; then
|
|
log "Downloading ${latestJarName}"
|
|
curl -H "Accept:application/octet-stream" -o "$SERVER" -fsSL https://api.github.com/repos/Luohuayu/CatServer/releases/assets/${latestJarId}
|
|
fi
|
|
|
|
export SKIP_LOG4J_CONFIG=true
|
|
|
|
# Continue to Final Setup
|
|
exec ${SCRIPTS:-/}start-finalSetupWorld "$@"
|