mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2024-06-07 19:40:43 +00:00
Added FORCE_REDOWNLOAD support for Bukkit/Spigot (#1879)
This commit is contained in:
parent
95da3c52bc
commit
c9341ec125
@ -421,6 +421,8 @@ Enable Bukkit/Spigot server mode by adding a `-e TYPE=BUKKIT` or `-e TYPE=SPIGOT
|
||||
-e TYPE=SPIGOT \
|
||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
||||
|
||||
If the downloaded server jar is corrupted, set `FORCE_REDOWNLOAD` to "true" to force a re-download during next container startup. After successfully re-downloading, you should remove that or set to "false".
|
||||
|
||||
If you are hosting your own copy of Bukkit/Spigot you can override the download URLs with:
|
||||
|
||||
- -e BUKKIT_DOWNLOAD_URL=<url>
|
||||
|
@ -72,7 +72,7 @@ function downloadSpigot {
|
||||
fi
|
||||
|
||||
setServerVar
|
||||
if [ -f $SERVER ]; then
|
||||
if [ -f "$SERVER" ] && ! isTrue "$FORCE_REDOWNLOAD"; then
|
||||
# tell curl to only download when newer
|
||||
curlArgs="-z $SERVER"
|
||||
fi
|
||||
@ -80,7 +80,7 @@ function downloadSpigot {
|
||||
curlArgs="$curlArgs -v"
|
||||
fi
|
||||
log "Downloading $match from $downloadUrl ..."
|
||||
curl -fsSL -o $SERVER $curlArgs "$downloadUrl"
|
||||
curl -fsSL -o "$SERVER" $curlArgs "$downloadUrl"
|
||||
if [[ $? != 0 || $(grep -c "DOCTYPE html" $SERVER) != 0 ]]; then
|
||||
cat <<EOF
|
||||
|
||||
@ -92,12 +92,12 @@ ERROR: failed to download from $downloadUrl
|
||||
|
||||
EOF
|
||||
|
||||
if isDebugging && [[ $(grep -c "DOCTYPE html" $SERVER) != 0 ]]; then
|
||||
cat $SERVER
|
||||
if isDebugging && [[ $(grep -c "DOCTYPE html" "$SERVER") != 0 ]]; then
|
||||
cat "$SERVER"
|
||||
fi
|
||||
|
||||
# remove invalid download
|
||||
rm $SERVER
|
||||
rm "$SERVER"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
@ -118,7 +118,7 @@ function setServerVar {
|
||||
|
||||
if isTrue "$BUILD_SPIGOT_FROM_SOURCE" || isTrue "$BUILD_FROM_SOURCE"; then
|
||||
setServerVar
|
||||
if [ ! -f $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||
if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then
|
||||
buildSpigotFromSource
|
||||
fi
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user