#!/bin/csh
# (modified by Gord-)
#
# 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,10,20,30,40,50 * * * *   /home/mydir/botchk
#

set chkbot=`ps x | grep "eggdrop" | grep -v "grep"`
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
