mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2024-06-07 19:40:43 +00:00
Improved handling of bad spigot/bukkit downloads via temp file
For #655
This commit is contained in:
parent
31b8535854
commit
e56a74dc81
@ -72,8 +72,9 @@ function downloadSpigot {
|
|||||||
zarg="-z $SERVER"
|
zarg="-z $SERVER"
|
||||||
fi
|
fi
|
||||||
log "Downloading $match from $downloadUrl ..."
|
log "Downloading $match from $downloadUrl ..."
|
||||||
curl -fsSL -o $SERVER $zarg "$downloadUrl"
|
tmpJar=/tmp/${getbukkitFlavor}.jar
|
||||||
if [[ $? != 0 || $(grep -c "DOCTYPE html" $SERVER) != 0 ]]; then
|
curl -fsSL -o "$tmpJar" $zarg "$downloadUrl"
|
||||||
|
if [[ $? != 0 || $(grep -c "DOCTYPE html" $tmpJar) != 0 ]]; then
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
ERROR: failed to download from $downloadUrl
|
ERROR: failed to download from $downloadUrl
|
||||||
@ -83,6 +84,7 @@ ERROR: failed to download from $downloadUrl
|
|||||||
EOF
|
EOF
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
|
mv "$tmpJar" "$SERVER"
|
||||||
|
|
||||||
JVM_OPTS="${JVM_OPTS} -DIReallyKnowWhatIAmDoingISwear"
|
JVM_OPTS="${JVM_OPTS} -DIReallyKnowWhatIAmDoingISwear"
|
||||||
export JVM_OPTS
|
export JVM_OPTS
|
||||||
|
Loading…
Reference in New Issue
Block a user