Skip to content

Instantly share code, notes, and snippets.

@gkhays
Created October 10, 2015 02:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gkhays/5b0caaf0390b5db9a78d to your computer and use it in GitHub Desktop.
Save gkhays/5b0caaf0390b5db9a78d to your computer and use it in GitHub Desktop.
#! /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