forked from itzg/docker-minecraft-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start-deployAirplane
36 lines (28 loc) · 1014 Bytes
/
start-deployAirplane
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/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" ] && [ "${JAVA_VER}" != "11" ]; then
log "ERROR: Airplane server type only supports Java versions 8 and 11"
exit 1
fi
if [ "${VERSION}" != "LATEST" ]; then
log "ERROR: Airplane server type only supports VERSION=LATEST"
exit 1
fi
export SERVER=airplane-${VANILLA_VERSION}-jdk${JAVA_VER}.jar
if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then
downloadUrl="https://dl.airplane.gg/latest/Airplane-JDK${JAVA_VER}/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 "$@"