Annotation of researchv10no/cmd/uucp/uudemon.poll, revision 1.1.1.1

1.1       root        1: #! /bin/sh
                      2: # This shell should be run out of crontab every hour,
                      3: #  a little before  uudemon.hour since this one
                      4: #  does not start the scheduler.
                      5: 
                      6: PATH=/bin:/usr/bin:/etc:/usr/lib/uucp
                      7: SPOOL=/usr/spool/uucp
                      8: 
                      9: POLLFILE=/usr/lib/uucp/Poll
                     10: # POLLFILE is a list of "system <tab> hour1 hour2 hour3 ..." for polling
                     11: # For example 
                     12: #      raven   2  6  10
                     13: # without the # at the beginning.  Lines starting with # are ignored.
                     14: # NOTE a tab must follow the machine name
                     15: 
                     16: umask 022
                     17: set +e
                     18: 
                     19: HOUR="`date '+%H'`"
                     20: # HOUR="`date | sed -e 's/:.*//' -e 's/^.*\(..\)$/\1/'"
                     21: HOUR=`expr $HOUR + 0`
                     22: 
                     23: cat $POLLFILE  |
                     24: sed -n -e "/^[^#].*[   ]$HOUR[         ]/s/    .*//p" -e "/^[^#].*[    ]$HOUR\$/s/     .*//p" |
                     25: while read site
                     26: do
                     27:        if test ! -d $SPOOL/$site
                     28:        then
                     29:                mkdir $SPOOL/$site
                     30:                chown uucp $SPOOL/$site
                     31:        fi
                     32: 
                     33:        j=`expr $site : '\(.\{1,7\}\)'`
                     34:        touch $SPOOL/$site/C.${j}n0000
                     35:        chown uucp $SPOOL/$site/C.${j}n0000
                     36: done

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.