grabrfc 804 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/rc
  2. # grabrfc - copy new rfcs and drafts into /lib/rfc
  3. rfork en
  4. path=(/bin)
  5. fn cd
  6. dom=`{ndb/query sys $sysname dom}
  7. ramfs
  8. ftpfs -q/ -a $user@$dom ftp.isi.edu
  9. found=no
  10. LIB=/lib/rfc
  11. cd /n/ftp/in-notes
  12. for(i in rfc*){
  13. target=`{echo $i | sed '
  14. s/.txt$//
  15. s/rfc0*/rfc/'}
  16. if(test ! -e $LIB/$target && test -f $i){
  17. cp $i $LIB/$target
  18. chmod 664 $LIB/$target
  19. found=yes
  20. echo $target
  21. }
  22. }
  23. if (~ $found yes)
  24. tr A-Z a-z <rfc-index.txt | sed 's/^0*//' |
  25. sed 's/^[0-9]/rfc&/' >$LIB/index
  26. unmount /n/ftp
  27. ftpfs -q/ -a $user@$dom ftp.ietf.org
  28. # copy in new ones
  29. found=no
  30. LIB=/lib/rfc/drafts
  31. cd /n/ftp/internet-drafts
  32. for(i in *){
  33. target=$i
  34. if (test ! -e $LIB/$target && test -f $i &&
  35. test `{ls -s $i | sed 's/ .*//'} -ge 2){
  36. cp $i $LIB/$target
  37. chmod 664 $LIB/$target
  38. echo drafts/$i
  39. }
  40. }