]> git.donarmstrong.com Git - infobot.git/blob - scripts/botchk.sh
f67b5d0a6c56d47532111af11e3eb57fe60f5a9c
[infobot.git] / scripts / botchk.sh
1 #!/bin/sh
2
3 BOTDIR=/home/apt/bot
4 BOTNICK=infobot
5 PIDFILE=$BOTDIR/$BOTNICK.pid
6
7 if [ -f $PIDFILE ]; then        # exists.
8     PID=`cat $PIDFILE`
9     if [ -d /proc/$PID ]; then  # already running.
10         exit 0
11     fi
12
13     # infobot removes the pid file.
14     echo "stale pid file; removing."
15 #    rm -f $PIDFILE
16 fi
17
18 cd $BOTDIR
19 ./infobot