]> git.lizzy.rs Git - plan9front.git/blob - lib/rfc/grabrfc
brk(2): .... we define lowest addres not used by the program above, so use that instead
[plan9front.git] / lib / rfc / grabrfc
1 #!/bin/rc
2 # grabrfc - copy new rfcs and drafts into /lib/rfc
3 rfork en
4 path=(/bin)
5 fn cd
6
7 dom=`{ndb/query sys $sysname dom}
8 if(~ $dom '') dom=$sysname
9
10 ramfs
11 ftpfs -q/ -a $user@$dom ftp.rfc-editor.org      # was ftp.isi.edu
12
13 found=no
14 LIB=/lib/rfc
15 cd /n/ftp/in-notes
16 for(i in rfc*){
17         target=`{
18                 echo $i | sed '
19                         s/.txt$//
20                         s/rfc0*/rfc/'
21         }
22         if(test ! -e $LIB/$target && test -f $i){
23                 cp $i $LIB/$target
24                 chmod 664 $LIB/$target
25                 found=yes
26                 echo $target
27         }
28 }
29 if (~ $found yes)
30         tr A-Z a-z <rfc-index.txt | sed 's/^0*//' |
31                 sed 's/^[0-9]/rfc&/' >$LIB/index
32 unmount /n/ftp
33
34 ftpfs -q/ -a $user@$dom ftp.ietf.org
35
36 # copy in new ones
37 found=no
38 LIB=/lib/rfc/drafts
39 mkdir -p $LIB
40 cd /n/ftp/internet-drafts
41 for(i in *){
42         target=$i
43         if (test ! -e $LIB/$target && test -f $i &&
44             test `{ls -s $i | sed 's/ .*//'} -ge 2){
45                 cp $i $LIB/$target
46                 chmod 664 $LIB/$target
47                 echo drafts/$i
48         }
49 }