mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-11-10 06:14:14 +00:00
32 lines
864 B
Bash
Executable file
32 lines
864 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# shellcheck source=start-utils
|
|
. "${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
|
|
logError "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 FAMILY=HYBRID
|
|
|
|
exec "${SCRIPTS:-/}start-spiget" "$@"
|