home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2 / Openstep-4.2-Intel-User.iso / NextLibrary / PrivateFrameworks / Uucp.framework / Versions / A / Resources / contrib / uudemon.shar / uudemon.poll < prev   
Text File  |  1993-10-05  |  941b  |  38 lines

  1. #!/bin/sh
  2. #
  3. # This is my impersonation of the HDB uudemon.poll script.
  4. # Yes, I know, this is very clumsy and clunky... ahh well, I've always
  5. # been better at C/pascal/etc than Shell programming... :(
  6.  
  7. # change LIBDIR to where UUCP library/conf. files are
  8. # change SPOOLDIR to the UUCP spool directory.  It must be HDB-ish.
  9. LIBDIR=/usr/lib/uucp; export LIBDIR
  10. SPOOLDIR=/usr/spool/uucp; export SPOOLDIR
  11.  
  12. ###  no changes needed past here  ###
  13.  
  14. HOUR=`date +%H`; export HOUR
  15.  
  16. if [ -f ${LIBDIR}/Poll ]; then
  17.     for SYS in `uuname`
  18.     do
  19.         CHOICES="`grep "^$SYS[    ]" ${LIBDIR}/Poll | awk -F'    ' \
  20.             '{ print $2 }'`"
  21.         DOIT="no"
  22.         for H in $CHOICES
  23.         do
  24.             if [ "$HOUR" = "$H" ]; then
  25.                 DOIT="yes"
  26.             fi
  27.         done
  28.         if [ "$DOIT" = "yes" ]; then
  29.             if [ ! -d ${SPOOLDIR}/${SYS} ]; then
  30.                 mkdir ${SPOOLDIR}/${SYS}
  31.             fi
  32.             chmod 755 ${SPOOLDIR}/${SYS}
  33.             touch ${SPOOLDIR}/${SYS}/C.${SYS}n0000
  34.             chmod 644 ${SPOOLDIR}/${SYS}/C.${SYS}n0000
  35.         fi
  36.     done
  37. fi
  38.