Skip to content

Instantly share code, notes, and snippets.

@aaomidi
Last active August 29, 2015 14:02
Show Gist options
  • Save aaomidi/5790d45cce7c972d21fe to your computer and use it in GitHub Desktop.
Save aaomidi/5790d45cce7c972d21fe to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
cd /mc/servers
for name in *; do
mark2 send -n "$name" say "Hey players! We're stopping the server to update them! Please join back in 10 minutes"
mark2 send -n "$name" stop ||true
done
echo "Starting to download updates and place them in the servers!" >&2
wget http://ci.md-5.net/job/Spigot/lastSuccessfulBuild/artifact/Spigot-Server/target/spigot.jar -O ~/server.jar
sleep 1m
for name in *; do
cp -f ~/server.jar "$name"
echo "Updated $name" >&2
mark2 start -i
done
echo "Update has sucessfully finished" >&2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment