#!/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"