Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/pi-hole/pi-hole.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'advanced/Templates/pihole-FTL.service')
-rw-r--r--advanced/Templates/pihole-FTL.service9
1 files changed, 8 insertions, 1 deletions
diff --git a/advanced/Templates/pihole-FTL.service b/advanced/Templates/pihole-FTL.service
index 9eb183ed..8a4c7ce6 100644
--- a/advanced/Templates/pihole-FTL.service
+++ b/advanced/Templates/pihole-FTL.service
@@ -13,7 +13,14 @@ FTLUSER=pihole
PIDFILE=/var/run/pihole-FTL.pid
get_pid() {
- pidof "pihole-FTL"
+ # First, try to obtain PID from PIDFILE
+ if [ -s "${PIDFILE}" ]; then
+ cat "${PIDFILE}"
+ return
+ fi
+
+ # If the PIDFILE is empty or not available, obtain the PID using pidof
+ pidof "pihole-FTL" | awk '{print $(NF)}'
}
is_running() {