]> jfr.im git - irc/gameservirc.git/blob - gameserv/cron/gscheck
updated the Change log w/ new additions
[irc/gameservirc.git] / gameserv / cron / gscheck
1 #!/bin/sh
2 #This file was taken from bnc2.8.6
3 GSBIN=gameserv
4 GSPIDFILE=gameserv.pid
5 GSPATH=/home/yourdir/gameserv
6
7
8
9
10 # Below here should be fine and left alone
11
12
13
14
15 cd $GSPATH
16 if test -r $GSPATH/$GSPIDFILE; then
17 GSPID=$(cat $GSPATH/$GSPIDFILE)
18 if $(kill -CHLD $GSPID >/dev/null 2>&1)
19 then
20 # lucky for us GameServ is still up
21 exit 0
22 fi
23 echo ""
24 echo "stale pid file (erasing it)"
25 rm -f $GSPATH/$GSPIDFILE
26 fi
27 echo ""
28 echo "GameServ is dead........restarting it"
29 echo ""
30 if test -x $GSBIN ;then
31 $GSPATH/$GSBIN
32 exit 0
33 fi
34 echo "could not reload"
35