secret
Created

God init script

  • Download Gist
god.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
#!/bin/bash
#
# God
#
# chkconfig: - 85 15
# description: start, stop, restart God
#
. /etc/rc.d/init.d/functions
RETVAL=0
god=/usr/local/bin/god
PID_FILE=/var/run/god.pid
LOG_FILE=/var/log/god/god.log
CONFIG_FILE=/etc/god/config.god
prog=$(basename $god)
 
case "$1" in
start)
$god -P $PID_FILE -l $LOG_FILE -c $CONFIG_FILE
RETVAL=$?
;;
stop)
kill `cat /var/run/god.pid`
RETVAL=$?
;;
restart)
kill `cat /var/run/god.pid`
$god -P $PID_FILE -l $LOG_FILE -c $CONFIG_FILE
RETVAL=$?
;;
status)
status $prog
RETVAL=$?
;;
*)
echo "Usage: god {start|stop|restart|status}"
exit 1
;;
esac
exit $RETVAL

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.