home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / util / unix / ftpscrip.tz / ftpscrip / FtpExtra / bin / ftpcheck < prev    next >
Encoding:
Text File  |  1991-09-09  |  1.4 KB  |  38 lines

  1. #!/bin/csh -f
  2.  
  3. # This script is responsible for running the scripts you have set up for
  4. # each site.  Probably primarily to get the new listings of files/abstracts
  5.  
  6. # The raw list of stuff found, and the shortened up version.  The short
  7. # version trims out all the files that weren't posted this month.  
  8. # Helpful for viewing.
  9. set out = $FTPEXTRAS/lists/archive.dir
  10. set out2 = $FTPEXTRAS/lists/archive.dir.short
  11.  
  12. # This block looks at your .netrc. For each place listed, it checks to 
  13. # see if you have a script file set up. If so, run it. Else go on to
  14. # the next site.  
  15. echo > $out 
  16. echo SITE '****    '  `date` >> $out
  17. echo SITE '****' >>  $out
  18. foreach place (`cat $HOME/.netrc | cut -c9-40`)
  19. if (-e $FTPEXTRAS/scripts/script.$place) then
  20. echo trying $place
  21. echo SITE '******************************************************' >>$out
  22. echo SITE $place >>$out
  23. echo SITE '******************************************************' >>$out
  24. ftp -v $place < $FTPEXTRAS/scripts/script.$place >>$out
  25. endif
  26. end
  27.  
  28. # This line filters out all the gunk and leaves only the relevant stuff.
  29. # i.e. this months files + formatting stuff.
  30. cat $out | sed -n -e /`date +%h`'[01-9 ]*:/p' -e /SITE/p -e /directory/p -e /later/p > $out2 
  31.  
  32. # If you always use only the short version, you could delete $out at
  33. # this point.  It would limit the functionality of a few other commands
  34. # but would save space.  Check your usage of: ftpmenu,ftpnew
  35. # before using this line.
  36. # rm $out
  37.  
  38.