mirror of
https://github.com/itzg/docker-minecraft-server
synced 2025-01-06 09:18:42 +00:00
parent
4099cde737
commit
391e807c78
1 changed files with 17 additions and 11 deletions
|
@ -67,12 +67,16 @@ function downloadSpigot {
|
||||||
downloadUrl="https://cdn.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VANILLA_VERSION}.jar"
|
downloadUrl="https://cdn.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VANILLA_VERSION}.jar"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
setServerVar
|
||||||
if [ -f $SERVER ]; then
|
if [ -f $SERVER ]; then
|
||||||
# tell curl to only download when newer
|
# tell curl to only download when newer
|
||||||
zarg="-z $SERVER"
|
curlArgs="-z $SERVER"
|
||||||
|
fi
|
||||||
|
if isDebugging; then
|
||||||
|
curlArgs="$curlArgs -v"
|
||||||
fi
|
fi
|
||||||
log "Downloading $match from $downloadUrl ..."
|
log "Downloading $match from $downloadUrl ..."
|
||||||
curl -fsSL -o $SERVER $zarg "$downloadUrl"
|
curl -fsSL -o $SERVER $curlArgs "$downloadUrl"
|
||||||
if [[ $? != 0 || $(grep -c "DOCTYPE html" $SERVER) != 0 ]]; then
|
if [[ $? != 0 || $(grep -c "DOCTYPE html" $SERVER) != 0 ]]; then
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
|
@ -88,17 +92,19 @@ EOF
|
||||||
export JVM_OPTS
|
export JVM_OPTS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setServerVar {
|
||||||
case "$TYPE" in
|
case "$TYPE" in
|
||||||
*BUKKIT|*bukkit)
|
*BUKKIT|*bukkit)
|
||||||
export SERVER=craftbukkit_server-${VANILLA_VERSION}.jar
|
export SERVER=craftbukkit_server-${VANILLA_VERSION}.jar
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
export SERVER=spigot_server-${VANILLA_VERSION}.jar
|
export SERVER=spigot_server-${VANILLA_VERSION}.jar
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
if isTrue "$BUILD_SPIGOT_FROM_SOURCE" || isTrue "$BUILD_FROM_SOURCE"; then
|
if isTrue "$BUILD_SPIGOT_FROM_SOURCE" || isTrue "$BUILD_FROM_SOURCE"; then
|
||||||
|
setServerVar
|
||||||
if [ ! -f $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
if [ ! -f $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||||
buildSpigotFromSource
|
buildSpigotFromSource
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue