Use RTMIN value provided by FTL when possible

Signed-off-by: Jack'lul <jacklulcat@gmail.com>
This commit is contained in:
Jack'lul 2025-07-18 10:34:02 +02:00
parent ae048201a2
commit da85a7a2a7
No known key found for this signature in database
GPG Key ID: A77E952141EFDABA

7
pihole
View File

@ -150,7 +150,7 @@ versionFunc() {
} }
reloadDNS() { reloadDNS() {
local svcOption svc str output status pid icon FTL_PID_FILE local svcOption svc str output status pid icon FTL_PID_FILE sigrtmin
svcOption="${1:-reload}" svcOption="${1:-reload}"
# get the current path to the pihole-FTL.pid # get the current path to the pihole-FTL.pid
@ -169,7 +169,10 @@ reloadDNS() {
str="FTL is not running" str="FTL is not running"
icon="${INFO}" icon="${INFO}"
else else
svc="kill -RTMIN ${pid}" sigrtmin="$(pihole-FTL sigrtmin 2>/dev/null)"
# Make sure sigrtmin is a number, otherwise fallback to RTMIN
[[ "${sigrtmin}" =~ ^[0-9]+$ ]] || unset sigrtmin
svc="kill -${sigrtmin:-RTMIN} ${pid}"
str="Reloading DNS lists" str="Reloading DNS lists"
icon="${TICK}" icon="${TICK}"
fi fi