Last active
April 8, 2017 17:45
-
-
Save bennet0496/21ec09d268c174db6820c9b75b4ce6eb to your computer and use it in GitHub Desktop.
Minecraft Startscript [TMUX] (ByteGaming Tutorial) https://www.bytegaming.de/?p=396
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 | |
#CHANGE ME!!!!!!!!!!!!! | |
ASUSER=minecraft | |
asuser(){ | |
if [ "`whoami`" = "$ASUSER" ]; then | |
/bin/bash -c "$@" | |
else | |
/bin/su -ml $ASUSER -c "$@" | |
fi | |
} | |
#CHANGE ME!!!!!!!!!!!!! | |
cd /path/to/minecraft/server | |
case $1 in | |
start) | |
asuser "tmux new -s minecraft -d java -jar minecraft_server.jar nogui" | |
;; | |
stop) | |
asuser "tmux send-keys -t minecraft '/stop' C-m" | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment