#!/bin/rc
debug=0
host=''
flags=()
sname=$user
tflag=''
while(! ~ $#* 0) {
switch ($1) {
case -d
debug=$2
shift
case -h
host=$2
shift
case -s
sname=$2
shift
case -t
tflag='-t'
shift
case -*
echo Usage: rh [-d level] [-h srvhost]
exit usage
}
shift
}
if (! test -e /mnt/trafficfs/ctl){
if (! ~ $debug '0') echo mounting trafficfs
if (! test -e /srv/trafficfs.$sname && ! ~ $host ''){
import -a $host /srv /srv
}
if (! mount -b /srv/trafficfs.$sname /mnt >/dev/null >[2]/dev/null){
rm -f /srv/trafficfs.$sname
if (! ~ $debug '0') echo starting trafficfs
games/trafficfs -s $sname
}
}
if (~ $tflag '-t') exec games/rushhour $tflag
if not exec games/rushhour
|