#!/bin/rc
rfork en
path = /bin # lose '.'
t1 = /tmp/idmirror.t1.^$pid^.^$sysname
t2 = /tmp/idmirror.t2.$pid^.^$sysname
dest = /lib/doc/ietf/drafts
myname = $user
myhost = $sysname
if (~ $#user 0) {
myname = unknown
}
if (~ $#sysname 0) {
myhost = unknown
}
flagfmt='d,v'
if(! ifs=() eval `{aux/getflags $*}) {
aux/usage
exit usage
}
if (~ $flagv 1) {
fn print { echo $* }
}
if not {
fn print {}
}
if (~ $flagd 1) {
opts = -d
}
if not {
opts = -q
fn sigexit {rm -f $t1 $t2; unmount /n/ftp; unmount /tmp}
ramfs
}
test -d $dest || mkdir -p $dest || exit $status
ftpfs $opts -K -a $myname^@^$myhost ftp.ietf.org
cd /n/ftp/internet-drafts
ls draft-*.txt > $t1
cd $dest
ls draft-*.txt > $t2 >[2]/dev/null
for (i in `{ comm -13 $t1 $t2 }) {
print '< ' $i
rm -f $i
}
cd /n/ftp/internet-drafts
for (i in `{ comm -23 $t1 $t2 }) {
print '> ' $i
tr -d \015 < $i > $dest/$i || exit $status
}
chmod u+w $dest/_*
tr -d \015 < 1id-index.txt > $dest/_index
tr -d \015 < 1id-abstracts.txt > $dest/_abstracts
|