home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / circle2.zip / autorun < prev    next >
Text File  |  1993-11-17  |  2KB  |  66 lines

  1. #!/bin/csh
  2. #
  3. # CircleMUD 2.0 autorun script
  4. # Originally by Fred C. Merkel
  5. # Copyright (c) 1993 The Trustees of The Johns Hopkins University
  6. # All Rights Reserved
  7. # See license.doc for more information
  8.  
  9. # If .fastboot exists, the script will sleep for only 5 seconds between reboot
  10. # attempts.  If .killscript exists, the script commit suicide (and remove
  11. # .killscript).  If pause exists, the script will repeatedly sleep for
  12. # 60 seconds and will not restart the mud until pause is removed.
  13.  
  14. set PORT=4000
  15. set FLAGS='-m -q'
  16.  
  17. while (1)
  18.  
  19.   set DATE = (`date`);
  20.   echo "autoscript starting game $DATE" >> syslog
  21.  
  22.   bin/circle $FLAGS $PORT >>& syslog
  23.  
  24.   fgrep "self-delete" syslog >> log/delete
  25.   fgrep "death trap" syslog >> log/dts
  26.   fgrep "killed" syslog >> log/rip
  27.   fgrep "Running" syslog >> log/restarts
  28.   fgrep "advanced" syslog >> log/levels
  29.   fgrep "equipment lost" syslog >> log/rentgone
  30.   fgrep "usage" syslog >> log/usage
  31.   fgrep "new player" syslog >> log/newplayers
  32.   fgrep "SYSERR" syslog >> log/errors
  33.   fgrep "(GC)" syslog >> log/godcmds
  34.   fgrep "Bad PW" syslog >> log/badpws
  35.  
  36.   rm log/syslog.1
  37.   mv log/syslog.2 log/syslog.1
  38.   mv log/syslog.3 log/syslog.2
  39.   mv log/syslog.4 log/syslog.3
  40.   mv log/syslog.5 log/syslog.4
  41.   mv log/syslog.6 log/syslog.5
  42.   mv syslog       log/syslog.6
  43.   touch syslog
  44.  
  45.   if (! -r .fastboot) then
  46.     sleep 40
  47.   else
  48.     rm .fastboot
  49.     sleep 5
  50.   endif
  51.  
  52.   if (-r .killscript) then
  53.     set DATE = (`date`);
  54.     echo "autoscript killed $DATE"  >> syslog
  55.     rm .killscript
  56.     exit
  57.   endif 
  58.  
  59.   while (-r pause) 
  60.     sleep 60
  61.   end
  62.  
  63. end
  64.  
  65.  
  66.