[arch-projects] [initscripts][PATCH 2/2] rc.d: allow specific daemons to be listed

Dave Reisner d at falconindy.com
Sun Jul 31 08:35:01 EDT 2011


We still default to listing all daemons if none are specified.

Signed-off-by: Dave Reisner <dreisner at archlinux.org>
---
 rc.d |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/rc.d b/rc.d
index a7b214e..bfc4719 100755
--- a/rc.d
+++ b/rc.d
@@ -33,7 +33,12 @@ case $1 in
 	list)
 		shift
 		cd /etc/rc.d/
-		for d in *; do
+		if (( $# )); then
+			daemons=("$@")
+		else
+			daemons=(*)
+		fi
+		for d in "${daemons[@]}"; do
 			have_daemon "$d" || continue
 			# print running / stopped satus
 			if ! ck_daemon "$d"; then
-- 
1.7.6



More information about the arch-projects mailing list