Plan 9 from Bell Labs’s /usr/web/sources/contrib/axel/rushhour/src/rh.rc

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/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

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.