mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-02-22 19:18:16 +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
1 changed files with 8 additions and 1 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Reference in a new issue