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