From b1b7e18d21acb8a27912ea9e3bafef491fc16f63 Mon Sep 17 00:00:00 2001 From: Sebastien Luttringer Date: Sat, 18 Jun 2011 02:06:14 +0200 Subject: 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 --- rc.d | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rc.d b/rc.d index 939538e..f5dd652 100755 --- a/rc.d +++ b/rc.d @@ -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 -- cgit v1.2.3