From b5ebff1894236ae188f047db78cdcdeedf47dfe1 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 20 Jul 2010 09:43:06 -0700 Subject: Use pgrep to count number of matching processes pgrep has simple flag to do what the ps | wc -l was doing. --- templates/system/ipv6/disable-forwarding/node.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/system/ipv6/disable-forwarding/node.def b/templates/system/ipv6/disable-forwarding/node.def index a029c81a..4d374455 100644 --- a/templates/system/ipv6/disable-forwarding/node.def +++ b/templates/system/ipv6/disable-forwarding/node.def @@ -34,7 +34,7 @@ delete: # If router advertisements were configured while global IPv6 # forwarding was disabled, we will need to start the radvd daemon # now. - running=`ps --no-headers -C radvd | wc -l` + running=$(pgrep -n radvd) if [ $running -eq 0 -a -e /etc/radvd.conf -a -x /etc/init.d/radvd ]; then /etc/init.d/radvd start fi -- cgit v1.2.3