summaryrefslogtreecommitdiff
path: root/lib/rfc/grabrfc
blob: 4e06df312ef05d30e9399f1a9ba94d434d30f9cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/rc
# grabrfc - copy new rfcs and drafts into /lib/rfc
rfork en
path=(/bin)
fn cd

dom=`{ndb/query sys $sysname dom}
if(~ $dom '') dom=$sysname

ramfs
ftpfs -q/ -a $user@$dom ftp.rfc-editor.org	# was ftp.isi.edu

found=no
LIB=/lib/rfc
cd /n/ftp/in-notes
for(i in rfc*){
	target=`{
		echo $i | sed '
			s/.txt$//
			s/rfc0*/rfc/'
	}
	if(test ! -e $LIB/$target && test -f $i){
		cp $i $LIB/$target
		chmod 664 $LIB/$target
		found=yes
		echo $target
	}
}
if (~ $found yes)
	tr A-Z a-z <rfc-index.txt | sed 's/^0*//' |
		sed 's/^[0-9]/rfc&/' >$LIB/index
unmount /n/ftp

ftpfs -q/ -a $user@$dom ftp.ietf.org

# copy in new ones
found=no
LIB=/lib/rfc/drafts
mkdir -p $LIB
cd /n/ftp/internet-drafts
for(i in *){
	target=$i
	if (test ! -e $LIB/$target && test -f $i &&
	    test `{ls -s $i | sed 's/ .*//'} -ge 2){
		cp $i $LIB/$target
		chmod 664 $LIB/$target
		echo drafts/$i
	}
}