summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2011-09-08 19:11:16 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2011-09-08 19:11:16 -0400
commit43db73a86f57829558ae85f1945c9aa65eab8edc (patch)
treefe307624fbea7edac13ffeb914331d6da70969f8
parent03b520370f6185d8604bc4068e8ac319c67e8703 (diff)
Modify daemon.sh to use pgrep instead of ps|grep
-rw-r--r--daemon.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/daemon.sh b/daemon.sh
index 1d4965a..4952639 100644
--- a/daemon.sh
+++ b/daemon.sh
@@ -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