diff options
author | Sebastien Luttringer <seblu@seblu.net> | 2011-06-18 02:06:14 +0200 |
---|---|---|
committer | Sebastien Luttringer <seblu@seblu.net> | 2011-06-18 04:09:32 +0200 |
commit | b1b7e18d21acb8a27912ea9e3bafef491fc16f63 (patch) | |
tree | 5b5caf1d345bfc72ab203ea150ea0a623eefb6c4 /rc.d | |
parent | 89a7dbb52543dd98d86440dfe8dd04e752f55337 (diff) |
rc.d: Add started/stopped option to list
This patch allow rc.d list started and rc.d list stopped which list respectively
only started and stopped daemons
Signed-off-by: Sebastien Luttringer <seblu@seblu.net>
Diffstat (limited to 'rc.d')
-rwxr-xr-x | rc.d | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -30,13 +30,16 @@ case $1 in usage ;; list) + shift cd /etc/rc.d/ for d in *; do have_daemon "$d" || continue # print running / stopped satus if ! ck_daemon "$d"; then + [[ "$1" == stopped ]] && continue printf "${C_OTHER}[${C_DONE}STARTED${C_OTHER}]" else + [[ "$1" == started ]] && continue printf "${C_OTHER}[${C_FAIL}STOPPED${C_OTHER}]" fi # print auto / manual status @@ -47,7 +50,7 @@ case $1 in fi printf " ${C_CLEAR}$d\n" done - ;; + ;; *) # check min args count (( $# < 2 )) && usage @@ -69,6 +72,7 @@ case $1 in fi (( ret += !! $? )) # clamp exit value to 0/1 done + ;; esac exit $ret |