#!/bin/bash### BEGIN INIT INFO# Provides: god# Required-Start: $all# Required-Stop: $all# Default-Start: 2 3 4 5# Default-Stop: 0 1 6# Short-Description: God### END INIT INFONAME=god
DESC=god
GOD_BIN=/usr/local/bin/god
UHOME=/home/halida
GOD_CONFIG=$UHOME/workspace/god/god.rb
GOD_LOG=$UHOME/workspace/god/log/god.log
GOD_PID=/var/run/god.pid
set -e
# Make sure the binary and the config file are present before proceedingif ! test -x $GOD_BIN;thenecho"Config file not found at ${GOD_BIN}"exit0fi# Create this file and put in a variable called GOD_CONFIG, pointing to# your God configuration fileif ! test -f $GOD_CONFIG;thenecho"Config file not found at ${GOD_CONFIG}"exit0fiRETVAL=0case"$1" in
start)echo -n "Starting $DESC: "$GOD_BIN -c $GOD_CONFIG -l $GOD_LOG -P $GOD_PIDRETVAL=$?echo"$NAME.";; stop)echo -n "Stopping $DESC: "$GOD_BIN quit
RETVAL=$?echo"$NAME.";; terminate)echo -n "Stopping $DESC and all tasks: "$GOD_BIN terminate
RETVAL=$?echo"$NAME.";; restart)echo -n "Restarting $DESC: "$GOD_BIN quit
$GOD_BIN -c $GOD_CONFIG -l $GOD_LOG -P $GOD_PIDRETVAL=$?echo"$NAME.";; status)$GOD_BIN status
RETVAL=$?;; *)echo"Usage: god {start|stop|terminate|restart|status}"exit1;;esacexit$RETVAL