#!/bin/rc
s=/n/dist/dist/replica
serverroot=/n/dist
serverlog=$s/plan9.log
serverproto=$s/plan9.proto
fn servermount {
9fs sources
bind /n/sources/plan9 /n/dist
}
fn serverupdate { status='' }
fn clientmount {
unmount /n/boot >[2]/dev/null
if(test -e /srv/fscons){
if(! test -e /srv/replica){
echo 'srv -AWP replica' >>/srv/fscons >[2]/dev/null ||
echo 'warning: could not write to /srv/fscons' >[1=2]
}
if(! mount -c /srv/replica /n/boot)
echo 'warning: cannot mount /srv/replica' >[1=2]
status=''
}
if not if(test -e /srv/kfs){
mount -c /srv/kfs /n/boot
status=''
}
if(! test -d /n/boot/dist/replica){
echo 'warning: could not mount /srv/replica or /srv/kfs; using /srv/boot' >[1=2]
mount -c /srv/boot /n/boot
}
if(! test -d /n/boot/dist/replica){
echo 'could not mount client root' >[1=2]
exit 'no /dist/replica'
}
status=''
}
c=/n/boot/dist/replica
clientroot=/n/boot
clientdb=$c/client/plan9.db
clientexclude=(dist/replica/client)
clientlog=$c/client/plan9.log
clientproto=$c/plan9.proto
applyopt=(-u -T$c/client/plan9.time)
|