docker-minecraft-server/scripts/start-deploySpongeVanilla

45 lines
1.1 KiB
Text
Raw Normal View History

#!/bin/bash
# shellcheck source=start-utils
. ${SCRIPTS:-/}start-utils
2020-03-06 15:52:17 +00:00
export TYPE=spongevanilla
: ${SPONGEBRANCH:=STABLE}
: ${SPONGEVERSION:=}
# Parse branch
2020-03-06 15:52:17 +00:00
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
2020-03-06 15:52:17 +00:00
log "Choosing Version for Sponge"
if [ "$SPONGEBRANCH" == "stable" ]; then
SPONGEVERSION=$(curl -fsSL https://dl-api.spongepowered.org/v1/org.spongepowered/$TYPE | jq -r '.buildTypes.stable.latest.version')
else
SPONGEVERSION=$(curl -fsSL https://dl-api.spongepowered.org/v1/org.spongepowered/$TYPE | jq -r '.buildTypes.bleeding.latest.version')
fi
fi
VERSION="$SPONGEVERSION"
export VERSION
export SERVER="spongevanilla-$SPONGEVERSION.jar"
if [ ! -e "$SERVER" ] || [ -n "$FORCE_REDOWNLOAD" ]; then
2020-03-06 15:52:17 +00:00
log "Downloading $SERVER ..."
curl -sSL -o "$SERVER" "https://repo.spongepowered.org/maven/org/spongepowered/$TYPE/$SPONGEVERSION/$SERVER"
fi
export FAMILY=SPONGE
exec "${SCRIPTS:-/}start-setupWorld" "$@"