Skip to content

Instantly share code, notes, and snippets.

Created October 29, 2011 22:46
Show Gist options
  • Save anonymous/1325191 to your computer and use it in GitHub Desktop.
Save anonymous/1325191 to your computer and use it in GitHub Desktop.
Minecraft stop.sh
#!/bin/bash
SLEEP_INT=10
SCREEN_NAME="mc"
AS_USER="craft"
send() {
su $AS_USER -c "screen -p 0 -S $SCREEN_NAME -X eval \"stuff '$1'\015\""
}
send "say The server is shutting down in 10 seconds."
send "say Saving the map..."
send "save-all"
sleep $SLEEP_INT
send "stop"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment