Created
October 29, 2011 22:46
-
-
Save anonymous/1325191 to your computer and use it in GitHub Desktop.
Minecraft stop.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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