#!/bin/rc rfork en flagfmt='d delay' args='url' if(! ifs=() eval `{aux/getflags $*} || ~ $#* 0){ aux/usage exit usage } if(~ $flagd '') flagd=60 fn check { echo request HEAD >$d/ctl echo url $* >$d/ctl if(cat $d/body >/dev/null) { if(! test -e $d/lastmodified) { echo no Last-Modified header >[1=2] exit headers } echo `{cat $d/lastmodified} } if not status='' } if(! test -e /mnt/web/ctl) webfs || exit { d=/mnt/web/^`{read <[0=3]} while(check $*) sleep $flagd } <>[3]/mnt/web/clone | awk '!x[$0]++'