1 #!/usr/lib/plan9/bin/rc
3 # Copyright (C) 2009 Andy Spencer
4 # See ../COPYING for terms
7 echo 'usage: '$0' <action> [start-|stop-]<service>'
9 echo ' -u,--is-up Test is service is running'
10 echo ' -d,--is-down Test is service is stopped'
11 echo ' -U,--set-up Set service to running'
12 echo ' -D,--set-down Set service to stopped'
13 echo ' -q,--query Print the state of a service'
18 STATE=/lib/mkinit/state
21 service=`{echo $2 | sed s/-.*//}
23 if(~ $action '' || ~ $service '')
28 test -e $STATE/$service
30 test ! -e $STATE/$service
36 echo -n Service "$service" is
37 test -e $STATE/$service \