#!/bin/sh

#
# A user was interested in seeing a write-pid feature and sent me this
# script. It is heavily based on the one from the IRC Proxy BNC, by
# Pharos. Since I know jack about shell scripting, I'm not even going to 
# bother hacking it to make it look original.
#

#
# Make sure you edit these!!!

EZBIN=ezbounce
EZPIDFILE=ezbounce.pid
EZPATH=/home/murat/myprogs/ezbounce-0.85/
EZCONF=ezbounce.conf.quick



# Below here should be fine and left alone




cd $EZPATH
if test -r $EZPATH/$EZPIDFILE; then
     EZPID=$(cat $EZPATH/$EZPIDFILE)
     if $(kill -CHLD $EZPID >/dev/null 2>&1)
     then
        exit 0
     fi
     echo ""
     echo "stale pid file (erasing it)"
     rm -f $EZPATH/$EZPIDFILE
fi
echo ""
echo "ezbounce is dead -- restarting"
echo ""
if test -x $EZBIN ;then
   $EZPATH/$EZBIN $EZCONF
   exit 0
fi
echo "could not reload"
  
