#!/bin/csh
#
# This is a script suitable for use in a crontab.  It checks your process
# list for an eggdrop bot.  If it doesn't find one, it will reload it.
# You'll need to edit this script for your bot.
#
# To check for your bot every 10 minutes, put the following line in your
# crontab:
#    0-59/10 * * * *   /home/mydir/botchk
#

set chkbot=`ps x | grep "eggdrop" | awk '$5=="eggdrop" { print $1 }'`
if "$chkbot" == "" then
  echo ""
  echo "Couldn't find the bot running.  Reloading it..."
  echo ""
  set oldcwd=$cwd

# change this to your home directory:
  cd ~mydir

# change this to your eggdrop command line:
  eggdrop MyBot

  cd $oldcwd
  unset oldcwd
endif
unset chkbot
