home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / d / d-linux.zip / dm-dist / nightrun < prev    next >
Text File  |  1991-03-01  |  794b  |  41 lines

  1. #!/bin/csh
  2.  
  3. # starter dmserver op til 10 gange, eller s}l{nge status != 0.
  4.  
  5. set max=10
  6. set counter=0
  7. echo "*** Nightrun started by $user at:" >> runlog
  8. date >> runlog
  9. tail -3 syslog >> runlog
  10. mv syslog syslog.old
  11. grep killed syslog.old >> lib/dead_log
  12. if (! -e lib/core) then
  13.  touch lib/core
  14.  chmod ug+r lib/core
  15. endif
  16.  
  17.  
  18. echo "Nightrun started by $USER at `date`." > syslog
  19.  
  20. while 1
  21.  
  22.  @ counter = ($counter + 1)
  23.  
  24.  echo "************* DIKUMUD REBOOT -- Run nr $counter *********" >> syslog
  25.  dmserver >>& syslog
  26.  set tmp=$status
  27.  
  28.  if (($tmp == 0) || ($counter == $max)) then
  29.   echo "Nightrun terminating (after run nr $counter)." >> syslog
  30.   exit
  31.  endif
  32.  
  33.  if ($tmp == 52) then
  34.     @ max = ($max + 1)
  35.  endif
  36.  
  37. echo "Nightrun ($user) restarting game at `date`." >> runlog
  38. tail -3 syslog >> runlog
  39.  
  40. end
  41.