mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-25 18:46:23 +00:00
[mc] New method of downloading newer spigot server executable.
using double pipe "||", bash will continue to the next statement if the first statement returns false or has an error. Using the -N option, wget will overwrite the file if it is newer. So, if the -O option was used, and both wget commands failed (both http and https were down) then wget would overwrite the file with a 0 byte copy and effectively delete it. -N works better in this case, since wget will not overwrite it with an empty file if it can't download it.
This commit is contained in:
@@ -62,9 +62,8 @@ case "$TYPE" in
|
||||
;;
|
||||
esac
|
||||
|
||||
#BAD Idea
|
||||
#rm -f $SERVER
|
||||
wget -q https://getspigot.org$URL
|
||||
#attempt https, and if it fails, fallback to http and download that way. Display error if neither works.
|
||||
wget -q -N spigot_server.jar https://getspigot.org$URL || (echo "Falling back to http, unable to contact server using https..." && wget -q -N spigot_server.jar http://getspigot.org$URL) || echo "Unable to download new copy of spigot server"
|
||||
|
||||
;;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user