Created
October 10, 2015 02:41
-
-
Save gkhays/5b0caaf0390b5db9a78d to your computer and use it in GitHub Desktop.
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/sh | |
# | |
# network Bring up/down networking | |
# | |
# chkconfig: 345 20 80 | |
# description: Starts and stops minecraft-server-nogui.sh | |
# | |
case "$1" in | |
start) | |
echo -n "Starting Minecraft Server" | |
/bin/su - ec2-user -c '/home/ec2-user/minecraft/start-nogui.sh' | |
echo "." | |
;; | |
stop) | |
echo -n "Stopping Minecraft Server" | |
kill `ps auxw | grep minecraft.jar | awk '{print $2}'` | |
echo "." | |
;; | |
*) | |
echo "Usage: /sbin/service minecraft-server {start|stop}" | |
exit 1 | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment