mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-03 12:40:56 +00:00
Merge pull request #2767 from pi-hole/fix/multiple_pihole-FTL_PIDs
Improve PID detection in pihole-FTL.service
This commit is contained in:
commit
afd28fab03
@ -13,7 +13,14 @@ FTLUSER=pihole
|
|||||||
PIDFILE=/var/run/pihole-FTL.pid
|
PIDFILE=/var/run/pihole-FTL.pid
|
||||||
|
|
||||||
get_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() {
|
is_running() {
|
||||||
|
Loading…
Reference in New Issue
Block a user