#!/bin/rc

switch($1){
case ''
	echo name of grid session to attach?
	GRIDSESS=`{read}
case *
	GRIDSESS=$1
}

if (! test -e /srv/g$GRIDSESS){
	echo no existing $GRIDSESS found
	exit
}
echo attaching to /srv/g$GRIDSESS
aux/stub -d /g
mount -c /srv/g$GRIDSESS /g
bind -c /g/grid /tmp/grid
rc </tmp/grid/info/plumber
