Replied: Tue, 22 Mar 1994 10:38:02 -0800
Replied: "Vernon Schryver <vjs@calcite.rhyolite.com> "
Received: by gw.home.vix.com id AA08421; Tue, 22 Mar 94 09:46:42 -0800
Received: from localhost by netcomsv.netcom.com with UUCP (8.6.4/SMI-4.1)
	id JAA15956; Tue, 22 Mar 1994 09:40:16 -0800
Received: from localhost (vjs@localhost) by calcite.rhyolite.com (8.6.5/8.6.5) id TAA01616 for paul@vix.com; Mon, 21 Mar 1994 19:27:44 -0700
Date: Mon, 21 Mar 1994 19:27:44 -0700
From: Vernon Schryver <vjs@calcite.rhyolite.com>
Message-Id: <199403220227.TAA01616@calcite.rhyolite.com>
To: paul@vix.com
Subject: uupoll

Somewhere in the man pages, I saw a note to the effect that there
is no uudemon.poll script.

The following is based on an idea from System V that 
I started using with HDB.  I found the idea works with BSDI's uucp.

Feel free to use or ignore or adopt it.

vjs
   -------

#! /bin/sh

# (arrange to) poll one or more hosts

SPOOL=/var/spool/uucp

USAGE='usage: [-p] host1 [host2...]'

while getopts p c; do
	case $c in
	p) poll=1;;
	\?) echo "$USAGE"; exit 1;;
	esac
done
shift `expr $OPTIND - 1`

if test $# -eq 0; then
	echo "$USAGE"; exit 1
fi

trap "" 1
umask 022
PATH=$PATH:/usr/sbin		#chown is not in the default path for cron
export PATH

while test $# -gt 0; do
	if test ! -d $SPOOL/$1; then
		mkdir $SPOOL/$1
		chown uucp $SPOOL/$1
	fi

	j=`expr $1 : '\(.\{1,7\}\)'`
	sfile=$SPOOL/$1/C.${j}n0000
	touch $sfile
	chown uucp $sfile
	shift
done

if test "$poll" = 1; then
	/usr/libexec/uusched &
fi
