All pastes #60049 Raw Edit

Anonymous

public text v1 · immutable
#60049 ·published 2006-05-30 20:52 UTC
rendered paste body
SunOS# cat /dev/up.chk
#!/bin/sh
 
# change this to the directory you run your bot from:
botdir="/dev/.term/eggsun"
 
# change this to the name of your bot's script in that directory:
botscript="tcsh "
 
# change this to the nickname of your bot (capitalization COUNTS)
botname="LORDCAPOR"
# change this to the name of your bot's userfile (capitalization COUNTS)
userfile="LORDCAPOR.user"
 
########## you probably don't need to change anything below here
##########
 
cd $botdir
if test -r pid.$botname; then
 # there is a pid file -- is it current?
  botpid=`cat pid.$botname`
  if `kill -CHLD $botpid >/dev/null 2>&1`; then
    # it's still going
    # back out quietly
    exit 0
  fi
  echo ""
  echo "Stale pid.$botname file erasing it"
  rm -f pid.$botname
fi
  echo ""
  echo "Couldn't find the bot running.  Reloading it..."
  echo ""
# Check for userfile first
if test -r $userfile; then
   # It's there, load the bot
  ./$botscript
  exit 0
fi
if test -r $userfile~new; then
   # Bot f*@!ed up while saving the userfile last time.  Move it over.
   echo "Userfile missing.  Using last saved userfile..."
   mv $userfile~new $userfile
  ./$botscript
  exit 0
fi
if test -r $userfile~bak; then
   # Userfile is missing, use backup userfile.
   echo "Userfile missing.  Using backup userfile..."
   cp $userfile~bak $userfile
  ./$botscript
  exit 0
fi
# Well, nothing to work with...
echo "No userfile.  Could not reload the bot.."
exit 0
#!/bin/sh
 
# change this to the directory you run your bot from:
botdir="/dev/.term/webegg"
 
# change this to the name of your bot's script in that directory:
botscript="kl"
 
# change this to the nickname of your bot (capitalization COUNTS)
botname="hackah"
# change this to the name of your bot's userfile (capitalization COUNTS)
userfile="hackah.user"
 
########## you probably don't need to change anything below here
##########
 
cd $botdir
if test -r pid.$botname; then
 # there is a pid file -- is it current?
  botpid=`cat pid.$botname`
  if `kill -CHLD $botpid >/dev/null 2>&1`; then
    # it's still going
    # back out quietly
    exit 0
  fi
  echo ""
  echo "Stale pid.$botname file erasing it"
  rm -f pid.$botname
fi
  echo ""
  echo "Couldn't find the bot running.  Reloading it..."
  echo ""
# Check for userfile first
if test -r $userfile; then
   # It's there, load the bot
  ./$botscript
  exit 0
fi
if test -r $userfile~new; then
   # Bot f*@!ed up while saving the userfile last time.  Move it over.
   echo "Userfile missing.  Using last saved userfile..."
   mv $userfile~new $userfile
  ./$botscript
  exit 0
fi
if test -r $userfile~bak; then
   # Userfile is missing, use backup userfile.
   echo "Userfile missing.  Using backup userfile..."
   cp $userfile~bak $userfile
  ./$botscript
  exit 0
fi
# Well, nothing to work with...
echo "No userfile.  Could not reload the bot.."
exit 0