home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!husc6!hao!ames!necntc!ncoast!allbery
- From: sfq@bcd-dyn.UUCP (sfq)
- Newsgroups: comp.sources.misc
- Subject: Calling another system over and over again
- Keywords: Shell script to keep trying until successful
- Message-ID: <5820@ncoast.UUCP>
- Date: 26 Nov 87 04:32:32 GMT
- Sender: allbery@ncoast.UUCP
- Organization: Battelle Columbus Division, Columbus, OH
- Lines: 47
- Approved: allbery@ncoast.UUCP
- X-Archive: comp.sources.misc/8711/18
-
- Over lunchtime, our system calls "dsacg1" to get any news or mail. However,
- our connection gets dropped frequently. The following shell script keeps
- calling the other system until a successful conversation is recorded.
-
- Invoke the script with a crontab entry like:
-
- 0-59 12 * * * /usr/lib/uucp/whack.system
-
- Simple, but effective.
-
- Stanley F. Quayle UUCP: cbosgd!osu-cis!bcd-dyn!sfq
- (614) 424-4052 USPS: 505 King Ave., Columbus, OH 43201
- N8SQ @ W8CQK Fido: Stanley Quayle, Node 126/2
- My opinions are mine. What more of a disclaimer could you need?
-
- - ------------------
- #! /bin/sh
-
- # Script to whack on DCSC. If uucico is not running to DCSC, and if the
- # last conversation was not successful, a call is forced.
-
- # Call this script once for each try calling DCSC.
-
- # Written 13 November 1987 by Stanley F. Quayle
-
- PATH=:/bin:/usr/bin:/usr/lib/uucp
- cd /usr/lib/uucp
-
- # If a lock file exists, exit
- test -r /usr/spool/uucp/LCK..dsacg1 && exit 0
-
- # Exit if the last status was "OK (conversation complete)"
- uulog -sdsacg1 | tail -1 | grep -s "OK (conversation complete)" && exit 0
-
- # Delete the status file
- rm -f /usr/spool/uucp/STST.dsacg1
-
- # Create a work file
- touch /usr/spool/uucp/C.dsacg1nPOLL
-
- # Call the system
- uucico -r1 -sdsacg1
- - --
- Stanley F. Quayle UUCP: cbosgd!osu-cis!bcd-dyn!sfq
- (614) 424-4052 USPS: 505 King Ave., Columbus, OH 43201
- N8SQ @ W8CQK Fido: Stanley Quayle, Node 126/2
- My opinions are mine. What more of a disclaimer could you need?
-