From fcd92d27f706cf2a0fd2049e75960fa1c6deb116 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Wed, 12 Apr 2017 19:34:13 +0200 Subject: [PATCH] Don't use PID file but rather "pidof pihole-FTL" for detecting if another process is already running --- advanced/pihole-FTL.service | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/advanced/pihole-FTL.service b/advanced/pihole-FTL.service index a2cbbab1..30cd140f 100644 --- a/advanced/pihole-FTL.service +++ b/advanced/pihole-FTL.service @@ -13,11 +13,11 @@ FTLUSER=pihole PIDFILE=/var/run/pihole-FTL.pid get_pid() { - cat "$PIDFILE" + pidof "pihole-FTL" } is_running() { - [ -f "$PIDFILE" ] && ps "$(get_pid)" > /dev/null 2>&1 + ps "$(get_pid)" > /dev/null 2>&1 } # Start the service