#!/bin/rc

# local command for master invoked by "run"

rfork ens
host=$1
if(! ~ $#* 1){
	echo usage: mrun host
	exit
}

# we are now on /usr/none
cd /usr

if(test -e pattern)
	alarm 60 /bin/cpu -h $host -P pattern -c /mnt/term/usr/none/srun
if not
	alarm 60 /bin/cpu -h $host -c /mnt/term/usr/none/srun

# check that if rx is available
# this must be after cpu command
cd /usr/none
alarm 10 /bin/rx $host 'echo $sysname' > host/$host
if(~ $status ?*)
	echo rx NG >> host/$host
if not
	echo rx OK >> host/$host
