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.
rm -f $SERVER was a bad idea, as it deletes the server file regardless
of whether wget is able to download a new one. If you keep a copy of
spigot_server in the server directory, wget will fail if it's unable to
pull the file and it wont delete what you already have.
- Allow -e WORLD=http://xxxx/world.zip to download archived world and unpack
- Allow 'adventure' and 'spectator' game modes
- Allow /mods and /config mounts for shared Forge mods without using /data
- Quote many strings in case of blank values
- Let VERSION take lowercase options, and set to LATEST if blank or invalid
- Enable command blocks by default (needed for adventure worlds)
- Allow DIFFICULTY to be given numerically
- default to empty banned-players and banned-ip files to avoid error message
WORLD=http://hostname/world.zip
Zipfile should contain world/ directory, and optionally any required mods in mods/ as well as optionally
a default server.properties file (overwritten by any env vars)
Also export volumes /mods and /config, the contents of which are copied to /data/mods and /data/config. This
allows shared read-only mounts for modules without affecting world.