home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume1 / 8711 / 18 < prev    next >
Internet Message Format  |  1990-07-13  |  2KB

  1. Path: uunet!husc6!hao!ames!necntc!ncoast!allbery
  2. From: sfq@bcd-dyn.UUCP (sfq)
  3. Newsgroups: comp.sources.misc
  4. Subject: Calling another system over and over again
  5. Keywords: Shell script to keep trying until successful
  6. Message-ID: <5820@ncoast.UUCP>
  7. Date: 26 Nov 87 04:32:32 GMT
  8. Sender: allbery@ncoast.UUCP
  9. Organization: Battelle Columbus Division, Columbus, OH
  10. Lines: 47
  11. Approved: allbery@ncoast.UUCP
  12. X-Archive: comp.sources.misc/8711/18
  13.  
  14. Over lunchtime, our system calls "dsacg1" to get any news or mail.  However,
  15. our connection gets dropped frequently.  The following shell script keeps
  16. calling the other system until a successful conversation is recorded.
  17.  
  18. Invoke the script with a crontab entry like:
  19.  
  20.     0-59 12 * * * /usr/lib/uucp/whack.system
  21.  
  22. Simple, but effective.
  23.  
  24. Stanley F. Quayle    UUCP: cbosgd!osu-cis!bcd-dyn!sfq
  25. (614) 424-4052        USPS: 505 King Ave., Columbus, OH  43201
  26. N8SQ @ W8CQK        Fido: Stanley Quayle, Node 126/2
  27. My opinions are mine.  What more of a disclaimer could you need?
  28.  
  29. - ------------------
  30. #! /bin/sh
  31.  
  32. # Script to whack on DCSC.  If uucico is not running to DCSC, and if the
  33. # last conversation was not successful, a call is forced.
  34.  
  35. # Call this script once for each try calling DCSC.
  36.  
  37. # Written 13 November 1987 by Stanley F. Quayle
  38.  
  39. PATH=:/bin:/usr/bin:/usr/lib/uucp
  40. cd /usr/lib/uucp
  41.  
  42. # If a lock file exists, exit
  43. test -r /usr/spool/uucp/LCK..dsacg1 && exit 0
  44.  
  45. # Exit if the last status was "OK (conversation complete)"
  46. uulog -sdsacg1 | tail -1 | grep -s "OK (conversation complete)" && exit 0
  47.  
  48. # Delete the status file
  49. rm -f /usr/spool/uucp/STST.dsacg1
  50.  
  51. # Create a work file
  52. touch /usr/spool/uucp/C.dsacg1nPOLL
  53.  
  54. # Call the system
  55. uucico -r1 -sdsacg1
  56. - -- 
  57. Stanley F. Quayle    UUCP: cbosgd!osu-cis!bcd-dyn!sfq
  58. (614) 424-4052        USPS: 505 King Ave., Columbus, OH  43201
  59. N8SQ @ W8CQK        Fido: Stanley Quayle, Node 126/2
  60. My opinions are mine.  What more of a disclaimer could you need?
  61.