3 # Copyright (C) 2009 Andy Spencer
4 # See ../COPYING for terms
8 usage: $0 <action> [start-|stop-]<service>
10 -u,--is-up Test is service is running
11 -d,--is-down Test is service is stopped
12 -U,--set-up Set service to running
13 -D,--set-down Set service to stopped
14 -q,--query Print the state of a service
20 STATE=/lib/mkinit/state
25 [ "$action" -a "$service" ] || usage
30 -u|--is-up ) test -e "$STATE/$service" ;;
31 -d|--is-down ) test ! -e "$STATE/$service" ;;
32 -U|--set-up ) touch "$STATE/$service" ;;
33 -D|--set-down ) rm "$STATE/$service" ;;
35 echo -n "Service \`$service' is "
36 test -e "$STATE/$service" \