#!/bin/sh
BNCBIN=/usr/sbin/bnc
BNCPIDFILE=/var/run/bnc.pid




# Below here should be fine and left alone




if test -r $BNCPIDFILE; then
     BNCPID=$(cat $BNCPIDFILE)
     if $(kill -CHLD $BNCPID >/dev/null 2>&1)
     then
     # lucky for us BNC is still up
        exit 0
     fi
     echo ""
     echo "stale pid file (erasing it)"
     rm -f $BNCPIDFILE
fi
echo ""
echo "BNC is dead........restarting BNC"
echo ""
if test -x $BNCBIN ;then
   $BNCBIN
   exit 0
fi
echo "could not reload"
  
