#!/usr/bin/env sh # # Nefarian.botchk (generated on November 09, 2006 @ 10:51AM) # # Generated by AutoBotchk 1.10 # Copyright (C) 1999, 2000, 2001, 2002, 2003 Jeff Fisher # # change this to the directory you run your bot from: botdir="/dir/to/bot" # change this to the name of your bot's script in that directory: botscript="/usr/local/bin/ruby main.rb" # change this to the name of your bot's pidfile (capitalization COUNTS) pidfile="bot.pid" ########## you probably don't need to change anything below here ########## cd "$botdir" # is there a pid file? if test -r $pidfile then # there is a pid file -- is it current? botpid=`cat $pidfile` if `kill -CHLD $botpid >/dev/null 2>&1` then # it's still going -- back out quietly exit 0 fi echo "" echo "Stale $pidfile file, erasing..." rm -f $pidfile fi echo "" echo "Couldn't find bot '$botname' running, reloading..." echo "" rm -f $pidfile $botscript >/dev/null 2>&1 exit 0 exit 0