ircddir="/home/darkspod/hybridssl" ircdcmd="/home/darkspod/hybridssl/bin/ircd" pidfile="/home/darkspod/hybridssl/etc/ircd.pid" ########## you probably don't need to change anything below here ########## cd $ircddir # is there a pid file? if test -r $pidfile then # there is a pid file -- is it current? ipid=`cat $pidfile` if `kill -CHLD $ipid >/dev/null 2>&1` then # it's still going -- back out quietly exit 0 fi echo "" echo "Stale $pidfile file, erasing..." rm -f $pidfile $ircdcmd fi