49 lines (42 with data), 1.0 kB
#!/bin/csh -f
#
# sh so others can use the fucker!
#
# Restart LPMud a lot of times, in case of a crash.
#
#limit datasize 6m
umask 022
cd /home/mud
#limit coredumpsize 0
unlimit coredumpsize
limit stacksize 5M
while ( 1 )
if -e lpc/NO_RESTART then
echo "lpc/NO_RESTART found; exiting."
exit 0
endif
if -f mudlib/bad.log then
# every couple of days or so, generate a new error digest
set doit = 1
if -f mudlib/error.digest then
set edok = `find mudlib/error.digest -mtime +2 -print | wc -l`
if ( $edok < 1 ) then
set doit = 0
endif
if ( $doit ) then
touch mudlib/error.digest
( cd mudlib ; ./MakeDigest ; mv bad.log bad.log.old ) &
endif
endif
endif
if -x lpc/shat then
# echo -n "runm0: `hostname`: " >> mudlib/UPSINCE
# date >> mudlib/UPSINCE
# new/shat -c
# ./lpc/shat -c >>& ./mudlib/admin/D_OUT
./lpc/shat -c
else
echo `date`': driver not found (server failure?) - sleeping'
sleep 300
endif
end