mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2024-06-07 19:40:43 +00:00
41 lines
1.1 KiB
Bash
Executable File
41 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
. ${SCRIPTS:-/}start-utils
|
|
|
|
export TYPE=spongevanilla
|
|
: ${SPONGEBRANCH:=STABLE}
|
|
: ${SPONGEVERSION:=}
|
|
|
|
# Parse branch
|
|
log "Choosing branch for Sponge"
|
|
case "$SPONGEBRANCH" in
|
|
|
|
EXPERIMENTAL|experimental|BLEEDING|bleeding)
|
|
SPONGEBRANCH=bleeding
|
|
;;
|
|
|
|
*)
|
|
SPONGEBRANCH=stable
|
|
;;
|
|
|
|
esac
|
|
|
|
# If not SPONGEVERSION selected, detect last version on selected branch
|
|
if [ -z $SPONGEVERSION ]; then
|
|
log "Choosing Version for Sponge"
|
|
if [ "$SPONGEBRANCH" == "stable" ]; then
|
|
export SPONGEVERSION=`curl -fsSL https://dl-api.spongepowered.org/v1/org.spongepowered/$TYPE | jq -r '.buildTypes.stable.latest.version'`
|
|
else
|
|
export SPONGEVERSION=`curl -fsSL https://dl-api.spongepowered.org/v1/org.spongepowered/$TYPE | jq -r '.buildTypes.bleeding.latest.version'`
|
|
fi
|
|
fi
|
|
|
|
export SERVER="spongevanilla-$SPONGEVERSION.jar"
|
|
|
|
if [ ! -e $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
|
log "Downloading $SERVER ..."
|
|
curl -sSL -o $SERVER https://repo.spongepowered.org/maven/org/spongepowered/$TYPE/$SPONGEVERSION/$SERVER
|
|
fi
|
|
|
|
exec ${SCRIPTS:-/}start-setupWorld $@
|