]> jfr.im git - irc/gameservirc.git/commitdiff
Added a crontab dir and scripts
authorkainazzzo <redacted>
Mon, 26 Apr 2004 03:54:36 +0000 (03:54 +0000)
committerkainazzzo <redacted>
Mon, 26 Apr 2004 03:54:36 +0000 (03:54 +0000)
git-svn-id: https://svn.code.sf.net/p/gameservirc/code/trunk@175 bc333340-6410-0410-a689-9d09f3c113fa

gameserv/cron/gs.cron [new file with mode: 0644]
gameserv/cron/gscheck [new file with mode: 0755]

diff --git a/gameserv/cron/gs.cron b/gameserv/cron/gs.cron
new file mode 100644 (file)
index 0000000..757e320
--- /dev/null
@@ -0,0 +1 @@
+0,5,10,15,20,25,30,35,40,45,50,55 * * * * /home/yourdir/gameserv/cron/gscheck
diff --git a/gameserv/cron/gscheck b/gameserv/cron/gscheck
new file mode 100755 (executable)
index 0000000..d402ff5
--- /dev/null
@@ -0,0 +1,35 @@
+#!/bin/sh
+#This file was taken from bnc2.8.6
+GSBIN=gameserv
+GSPIDFILE=gameserv.pid
+GSPATH=/home/yourdir/gameserv
+
+
+
+
+# Below here should be fine and left alone
+
+
+
+
+cd $GSPATH
+if test -r $GSPATH/$GSPIDFILE; then
+     GSPID=$(cat $GSPATH/$GSPIDFILE)
+     if $(kill -CHLD $GSPID >/dev/null 2>&1)
+     then
+     # lucky for us GameServ is still up
+        exit 0
+     fi
+     echo ""
+     echo "stale pid file (erasing it)"
+     rm -f $GSPATH/$GSPIDFILE
+fi
+echo ""
+echo "GameServ is dead........restarting it"
+echo ""
+if test -x $GSBIN ;then
+   $GSPATH/$GSBIN
+   exit 0
+fi
+echo "could not reload"
+