diff options
-rwxr-xr-x | examples/perfcounter/perfcountd.init | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/perfcounter/perfcountd.init b/examples/perfcounter/perfcountd.init index 683e91395b..8a89fad2b5 100755 --- a/examples/perfcounter/perfcountd.init +++ b/examples/perfcounter/perfcountd.init @@ -21,15 +21,15 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin -killproc() +killproc() { pid=`ps aux | grep $1 | egrep -v '(grep|perfcountd)' | awk '{print $2}'` - if [ "$pid" != "" ]; then + if [ -z "$pid" ]; then kill $pid fi } -# Start/stop processes +# Start/stop processes case "$1" in |