mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-11-10 14:24:28 +00:00
37 lines
914 B
Bash
37 lines
914 B
Bash
#!/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)
|
|
|
|
if [ "${JAVA_VER}" = "8" ]; then
|
|
JDK=8
|
|
else
|
|
JDK=11
|
|
fi
|
|
|
|
if [ "${VERSION}" != "LATEST" ]; then
|
|
log "ERROR: Airplane server type only supports VERSION=LATEST"
|
|
exit 1
|
|
fi
|
|
|
|
export SERVER=airplane-${VANILLA_VERSION}-jdk${JDK}.jar
|
|
|
|
if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then
|
|
downloadUrl="https://dl.airplane.gg/latest/Airplane-JDK${JDK}/launcher-airplane.jar"
|
|
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
|
|
|
|
exec ${SCRIPTS:-/}start-spiget "$@"
|