#!/bin/rc # user facing grid orchestration helper rfork griduser=$user while (~ $1 -*){ switch($1){ case -u griduser=$2 shift case -d reqdial=$2 shift case -h targhost=$2 shift } shift } if(~ $targhost tcp!*) hostdial=$targhost if not hostdial=tcp!^$targhost^!16998 if(~ $#reqdial 0) reqdial=tcp!^$targhost^!16999 if(! test -e /n/g/sto.in) srvtls $hostdial $targhost.gridsvc.$pid /n/g if(! test -e /n/g/sto.in){ echo no grid service found at /n/g >[2=1] exit } echo 'scores | spawn scorename | save oldname newname | invite user scorename | boom scorename | status' cat /n/g/sto.out & catkill1=$apid cat /n/g/sto.err & catkill2=$apid cat /n/g/cpu.out & catkill3=$apid cat /n/g/cpu.err & catkill4=$apid fn killcats{ @{echo kill>/proc/$catkill1/ctl} @{echo kill>/proc/$catkill2/ctl} @{echo kill>/proc/$catkill3/ctl} @{echo kill>/proc/$catkill4/ctl} } while(usercmd=`{read}){ switch($usercmd){ case exit killcats exit case * tlsclient -a $reqdial /bin/echo $usercmd sleep 1 echo $griduser req >>/n/g/sto.in } }