#!/bin/csh
#
# scan the ps list for an eggdrop bot... if found, give a warning message
# otherwise, load eggdrop
#
set chkbot=`ps x | grep "eggdrop" | awk '$5=="./eggdrop" { print $1 }'`
if "$chkbot" != "" then
  echo ""
  echo "There is already a bot running -- process #" $chkbot
  echo ""
else
  echo ""
  echo "Couldn't find the bot running.  Reloading it..."
  echo ""
  set oldcwd=$cwd
# obviously, change this to your directory:
  cd ~robey/eggdrop
# obviously, change this to your command line:
  ./eggdrop gayteen
  cd $oldcwd
  unset oldcwd
endif
unset chkbot
