]> git.donarmstrong.com Git - infobot.git/blob - scripts/botchk.sh
7ed1b0d9e8ddf8e4caa3e4c0c130131adf43e730
[infobot.git] / scripts / botchk.sh
1 #!/bin/sh
2
3 BOTDIR=/home/apt/bot
4 BOTNICK=blootbot
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     # blootbot removes the pid file.
14     echo "stale pid file; removing."
15 #    rm -f $PIDFILE
16 fi
17
18 cd $BOTDIR
19 ./blootbot