[ircd@oblivion ~/hybridssl/etc]$ cat ircdchk
ircddir="/home/ircd/hybridssl"
ircdcmd="/home/ircd/hybridssl/bin/ircd"
pidfile="/home/ircd/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
[ircd@oblivion ~/hybridssl/etc]$