home *** CD-ROM | disk | FTP | other *** search
- #!/bin/csh
- #
- # useage: poll sys [sys ...]
- #
- # Poll systems given on the command line.
- #
- # History: 10/18/1988 Resurected off of a backup
- # and hacked to life.
- # - R.M. Bownes III
- #
-
- echo $argv
-
- # Check for the presence of a LCK..poll file
-
- if (-e /usr/spool/uucp/LCK..poll) then
-
- # Look for a currently executing poll.
-
- if (`ps -elf | grep -c poll` > 0 ) then
- echo "Already a poll in progress"
- exit
- endif
-
- # Look for a currently running uucp.
-
- if (`ps -elf | grep -c uucico` > 0 ) then
- echo "Already a uucp in progress"
- sleep 300
- exec /usr/lib/uucp/poll
- endif
-
- # Guess it didnt exist, LCK..poll must be from before the crash...
-
- rm /usr/spool/uucp/LCK..poll
- rm /usr/spool/uucp/STST*
- endif
-
- # Look for a user logged in.
-
- if (`who | grep -c tty01` > 0 ) then
- echo `who | grep tty01 | awk -e '{print $1}'` is on tty01
- sleep 300
- exec /usr/lib/uucp/poll
- endif
-
- # Look for some other uucico going on.
-
- #if (`ps -elf | grep -c uucico` > 0 ) then
- # echo `ps -elf | grep uucico ` is currently in progress.
- # sleep 300
- # exec /usr/lib/uucp/poll
- #endif
-
- # Get ready to dial out.
-
- touch /usr/spool/uucp/LCK..poll
- disable /dev/tty01
-
- # Do the actual uucp
-
- while ($1 != "")
- echo Polling $1
- /usr/lib/uucp/uucico -r1 -s$1
- shift
- end
-
- # Done with all the uucps, get around the Xenix enable/disable bug.
-
- sleep 60
- enable tty01
-
- # clean up and let us outa here.
-
- rm /usr/spool/uucp/LCK..poll
-