home *** CD-ROM | disk | FTP | other *** search
/ ftp.jcu.edu.au / 2014.06.ftp.jcu.edu.au.tar / ftp.jcu.edu.au / bin / pipe-access.sh
Linux/UNIX/POSIX Shell Script  |  2006-11-21  |  925b  |  38 lines

  1. #!/bin/bash
  2.  
  3. date
  4.  
  5. MASTER="/san/anonftp/public"
  6. ETC="$MASTER/etc"
  7. PUB="$MASTER/pub"
  8.  
  9. WGET=/usr/bin/wget
  10.  
  11. #    $WGET -NO $ETC/qld.txt http://www.pipenetworks.com/docs/prefixes/qld.txt
  12.  
  13. awk -F, '$0!~/^#/ {print "    Allow from",$1}' $ETC/qld.txt \
  14.     > $ETC/qld_access.txt
  15.  
  16. ( \
  17. echo "# ccjsc: automaintained by: /san/anonftp/public/bin/pipe-access.sh" ; \
  18. echo "<Class pipe>" ; \
  19. awk -F, '$0!~/^#/ {print "    From",$1}' $ETC/qld.txt ; \
  20. echo "</Class>" \
  21. ) \
  22.     > $ETC/proftpd_qld.txt
  23.  
  24. #if [ -s $ETC/.ftpaccess.master -a -s $ETC/qld_access.txt -a -s $ETC/.ftpaccess.lastline ]
  25. #then
  26. #    cat $ETC/.ftpaccess.master $ETC/qld_access.txt $ETC/.ftpaccess.lastline \
  27. #    > $ETC/.ftpaccess
  28. #fi
  29.  
  30. if [ -s $ETC/.htaccess.master -a -s $ETC/qld_access.txt -a -s $ETC/.htaccess.lastline ]
  31. then
  32.     cat $ETC/.htaccess.master $ETC/qld_access.txt $ETC/.htaccess.lastline \
  33.     > $ETC/.htaccess
  34. fi
  35.  
  36. chmod 644 $ETC/.ftpaccess $ETC/.htaccess $ETC/proftpd_qld.txt
  37. echo
  38.