diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2011-09-08 19:11:16 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2011-09-08 19:11:16 -0400 |
commit | 43db73a86f57829558ae85f1945c9aa65eab8edc (patch) | |
tree | fe307624fbea7edac13ffeb914331d6da70969f8 | |
parent | 03b520370f6185d8604bc4068e8ac319c67e8703 (diff) |
Modify daemon.sh to use pgrep instead of ps|grep
-rw-r--r-- | daemon.sh | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -2,11 +2,11 @@ TMP=${TMPDIR-/tmp}/daemon -running=$(ps -u `whoami` -U `whoami` -o comm|grep -- "$1") +running=$(pgrep -u `whoami` "$1") if [ -z "$running" ]; then mkdir -p "$TMP" echo "daemon: starting $1" nohup $@ > "$TMP/$1.out" 2> "$TMP/$1.err" & else echo "daemon: $1 is already running" -fi
\ No newline at end of file +fi |