From 27588a903d0e6fd4ad79d57e5c47095842335c0e Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Tue, 30 Mar 1999 22:43:04 +0000 Subject: fix for pid grep in status --- rc.d/init.d/functions | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'rc.d') diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index d15f19a0..f22f4941 100755 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -171,7 +171,10 @@ status() { echo "$1 (pid $pid) is running..." return 0 else - pid=`ps auxww Op | awk '{ if ($12 ~ /^[^[]'"$1"'/) print $2}'` + pid=`ps ax | awk 'BEGIN { prog=ARGV[1]; ARGC=1 } + { if ((prog == $5) || (("(" prog ")") == $5) || + (("[" prog "]") == $5) || + ((prog ":") == $5)) { print $1 ; exit 0 } }' $1` if [ "$pid" != "" ] ; then echo "$1 (pid $pid) is running..." return 0 -- cgit v1.2.1