docker-minecraft-server/scripts/start-deployAirplane

47 lines
1.1 KiB
Plaintext
Raw Normal View History

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