42 lines
1.0 KiB
Bash
42 lines
1.0 KiB
Bash
#! /bin/sh
|
|
|
|
#ident "$Revision: 1.6 $"
|
|
|
|
# This shell should be run out of crontab once an hour,
|
|
# a little before uudemon.hour since this one does not start the scheduler.
|
|
|
|
# See /usr/lib/uucp/pollhost, a script that schedules polling from
|
|
# command line arguements, and so can used from cron to schedule
|
|
# polling at finer granularity than hours.
|
|
|
|
|
|
PATH=/bin:/usr/bin:/etc:/usr/lib/uucp
|
|
SPOOL=/var/spool/uucp
|
|
|
|
# POLLFILE is a list of "system <tab> hour1 hour2 hour3 ..." for polling
|
|
# For example
|
|
# raven 2 6 10
|
|
# without the # at the beginning. Lines starting with # are ignored.
|
|
# NOTE a tab must follow the machine name
|
|
POLLFILE=/etc/uucp/Poll
|
|
|
|
umask 022
|
|
set +e
|
|
|
|
HOUR="`date '+%H'`"
|
|
HOUR=`expr $HOUR + 0`
|
|
|
|
sed -n -e "/^[^#].*[ ]$HOUR[ ]/s/ .*//p" \
|
|
-e "/^[^#].*[ ]$HOUR\$/s/ .*//p" $POLLFILE \
|
|
| while read site; do
|
|
if test ! -d $SPOOL/$site
|
|
then
|
|
mkdir $SPOOL/$site
|
|
chown uucp $SPOOL/$site
|
|
fi
|
|
|
|
j=`expr $site : '\(.\{1,7\}\)'`
|
|
touch $SPOOL/$site/C.${j}n0000
|
|
chown uucp $SPOOL/$site/C.${j}n0000
|
|
done
|