Created
June 12, 2011 14:09
-
-
Save Psli/1021584 to your computer and use it in GitHub Desktop.
/etc/init.d/god
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 | |
# | |
# God | |
# | |
# chkconfig: - 85 15 | |
# description: start, stop, restart God | |
# sudo chmod a+x /etc/init.d/god | |
# sudo chkconfig --add god | |
# sudo chkconfig --level 345 god on | |
RETVAL=0 | |
case "$1" in | |
start) | |
/usr/local/bin/god -P /var/run/god.pid -l /var/log/god.log && /usr/local/bin/god load /etc/god.conf | |
RETVAL=$? | |
;; | |
stop) | |
kill `cat /var/run/god.pid` | |
RETVAL=$? | |
;; | |
restart) | |
kill `cat /var/run/god.pid` | |
/usr/local/bin/god -P /var/run/god.pid -l /var/log/god.log && /usr/local/bin/god load /etc/god.conf | |
RETVAL=$? | |
;; | |
status) | |
RETVAL=$? | |
;; | |
*) | |
echo "Usage: god {start|stop|restart|status}" | |
exit 1 | |
;; | |
esac | |
exit $RETVAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment