2021-04-08 23:50:06 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
. ${SCRIPTS:-/}start-utils
|
2021-12-11 18:56:11 +00:00
|
|
|
set -euo pipefail
|
2021-04-08 23:50:06 +00:00
|
|
|
isDebugging && set -x
|
|
|
|
|
2021-12-11 18:56:11 +00:00
|
|
|
IFS=$'\n\t'
|
|
|
|
|
2022-01-24 00:34:00 +00:00
|
|
|
if [ "${VERSION}" != "LATEST" ] && [ "${VERSION}" != "PURPUR" ] ; then
|
|
|
|
log "ERROR: Airplane server type only supports VERSION=LATEST, VERSION=PURPUR."
|
2021-06-24 03:29:58 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-07-21 15:16:05 +00:00
|
|
|
: ${AIRPLANE_TYPE:=airplane}
|
2021-04-08 23:50:06 +00:00
|
|
|
|
2022-01-24 00:34:00 +00:00
|
|
|
if [ "${VERSION}" = "LATEST" ] ; then
|
|
|
|
AIRPLANE_TYPE="airplane"
|
2021-06-24 03:29:58 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${VERSION}" = "PURPUR" ]; then
|
2021-07-21 15:16:05 +00:00
|
|
|
AIRPLANE_TYPE="airplanepurpur"
|
2021-07-13 00:03:17 +00:00
|
|
|
fi
|
|
|
|
|
2022-01-24 00:34:00 +00:00
|
|
|
log "Using ${AIRPLANE_TYPE} 1.17.1 (1.18 unsupported - use Paper/Pufferfish/Purpur for newer versions)"
|
2021-06-24 12:46:40 +00:00
|
|
|
|
2022-01-24 00:34:00 +00:00
|
|
|
export SERVER=${AIRPLANE_TYPE}-1.17.1.jar
|
2021-04-08 23:50:06 +00:00
|
|
|
|
2021-12-11 18:56:11 +00:00
|
|
|
log "Removing old Airplane versions ..."
|
|
|
|
shopt -s nullglob
|
2022-01-24 00:34:00 +00:00
|
|
|
for f in airplane*.jar; do
|
2021-12-11 18:56:11 +00:00
|
|
|
[[ $f != $SERVER ]] && rm $f
|
|
|
|
done
|
|
|
|
|
2021-07-16 12:26:49 +00:00
|
|
|
if [ ! -f "$SERVER" ] || isTrue "${FORCE_REDOWNLOAD:-false}"; then
|
2022-01-24 00:34:00 +00:00
|
|
|
downloadUrl="https://airplane.gg/dl/launcher-${AIRPLANE_TYPE}1.17.1.jar"
|
2021-04-08 23:50:06 +00:00
|
|
|
log "Downloading Airplane from $downloadUrl ..."
|
2022-01-06 12:49:46 +00:00
|
|
|
if ! get -o "$SERVER" "$downloadUrl"; then
|
2021-04-08 23:50:06 +00:00
|
|
|
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
|
|
|
exit 3
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Normalize on Spigot for later operations
|
2021-12-11 02:50:40 +00:00
|
|
|
export FAMILY=SPIGOT
|
2021-04-08 23:50:06 +00:00
|
|
|
|
2022-01-17 02:49:15 +00:00
|
|
|
exec "${SCRIPTS:-/}start-spiget" "$@"
|