2021-04-08 23:50:06 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
IFS=$'\n\t'
|
|
|
|
|
|
|
|
. ${SCRIPTS:-/}start-utils
|
|
|
|
isDebugging && set -x
|
|
|
|
|
|
|
|
JAVA_VER=$(java -version 2>&1 | head -1 | cut -d'"' -f2 | sed '/^1\./s///' | cut -d'.' -f1)
|
|
|
|
|
2021-06-09 12:35:00 +00:00
|
|
|
if [ "${JAVA_VER}" = "8" ]; then
|
|
|
|
JDK=8
|
|
|
|
else
|
|
|
|
JDK=11
|
2021-04-08 23:50:06 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${VERSION}" != "LATEST" ]; then
|
|
|
|
log "ERROR: Airplane server type only supports VERSION=LATEST"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-06-09 12:35:00 +00:00
|
|
|
export SERVER=airplane-${VANILLA_VERSION}-jdk${JDK}.jar
|
2021-04-08 23:50:06 +00:00
|
|
|
|
2021-04-09 17:25:51 +00:00
|
|
|
if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then
|
2021-06-09 12:35:00 +00:00
|
|
|
downloadUrl="https://dl.airplane.gg/latest/Airplane-JDK${JDK}/launcher-airplane.jar"
|
2021-04-08 23:50:06 +00:00
|
|
|
log "Downloading Airplane from $downloadUrl ..."
|
|
|
|
curl -fsSL -o "$SERVER" "$downloadUrl"
|
|
|
|
if [ ! -f "$SERVER" ]; then
|
|
|
|
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
|
|
|
exit 3
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Normalize on Spigot for later operations
|
|
|
|
export TYPE=SPIGOT
|
|
|
|
export SKIP_LOG4J_CONFIG=true
|
|
|
|
|
2021-04-13 01:21:53 +00:00
|
|
|
exec ${SCRIPTS:-/}start-spiget "$@"
|