summaryrefslogtreecommitdiff
path: root/daemon.sh
diff options
context:
space:
mode:
Diffstat (limited to 'daemon.sh')
-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