grabrfc 840 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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.rfc-editor.org # was ftp.isi.edu
  9. found=no
  10. LIB=/lib/rfc
  11. cd /n/ftp/in-notes
  12. for(i in rfc*){
  13. target=`{
  14. echo $i | sed '
  15. s/.txt$//
  16. s/rfc0*/rfc/'
  17. }
  18. if(test ! -e $LIB/$target && test -f $i){
  19. cp $i $LIB/$target
  20. chmod 664 $LIB/$target
  21. found=yes
  22. echo $target
  23. }
  24. }
  25. if (~ $found yes)
  26. tr A-Z a-z <rfc-index.txt | sed 's/^0*//' |
  27. sed 's/^[0-9]/rfc&/' >$LIB/index
  28. unmount /n/ftp
  29. ftpfs -q/ -a $user@$dom ftp.ietf.org
  30. # copy in new ones
  31. found=no
  32. LIB=/lib/rfc/drafts
  33. cd /n/ftp/internet-drafts
  34. for(i in *){
  35. target=$i
  36. if (test ! -e $LIB/$target && test -f $i &&
  37. test `{ls -s $i | sed 's/ .*//'} -ge 2){
  38. cp $i $LIB/$target
  39. chmod 664 $LIB/$target
  40. echo drafts/$i
  41. }
  42. }