mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 10:43:55 +00:00
Use FTL's new dns-port API endpoint
Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
parent
5729f64ddc
commit
f45248df80
1 changed files with 9 additions and 9 deletions
18
pihole
18
pihole
|
@ -312,7 +312,7 @@ analyze_ports() {
|
||||||
}
|
}
|
||||||
|
|
||||||
statusFunc() {
|
statusFunc() {
|
||||||
# Determine if there is pihole-FTL service is listening on any UDP port
|
# Determine if there is pihole-FTL service is listening
|
||||||
local listening pid port
|
local listening pid port
|
||||||
|
|
||||||
pid="$(getFTLPID)"
|
pid="$(getFTLPID)"
|
||||||
|
@ -323,21 +323,22 @@ statusFunc() {
|
||||||
esac
|
esac
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
#get the port pihole-FTL is listening on
|
#get the port pihole-FTL is listening on by using FTL's telnet API
|
||||||
port="$(lsof -Pni UDP -p ${pid} -a | grep -m1 : | awk -F ":" '{print $2}')"
|
port="$(echo ">dns-port >quit" | nc 127.0.0.1 4711)"
|
||||||
listening="$(lsof -Pni:53)"
|
listening="$(lsof -Pni:53)"
|
||||||
if [[ ! -z "$port" ]]; then
|
if [[ "${port}" == "0" ]]; then
|
||||||
if [[ "${1}" != "web" ]] && [[ "$port" -eq 53 ]]; then
|
|
||||||
analyze_ports "${listening}"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
case "${1}" in
|
case "${1}" in
|
||||||
"web") echo "-1";;
|
"web") echo "-1";;
|
||||||
*) echo -e " ${CROSS} DNS service is NOT listening";;
|
*) echo -e " ${CROSS} DNS service is NOT listening";;
|
||||||
esac
|
esac
|
||||||
return 0
|
return 0
|
||||||
|
else
|
||||||
|
if [[ "${1}" != "web" ]] && [[ "$port" -eq 53 ]]; then
|
||||||
|
analyze_ports "${listening}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Determine if Pi-hole's blocking is enabled
|
# Determine if Pi-hole's blocking is enabled
|
||||||
if grep -q "BLOCKING_ENABLED=false" /etc/pihole/setupVars.conf; then
|
if grep -q "BLOCKING_ENABLED=false" /etc/pihole/setupVars.conf; then
|
||||||
# A config is commented out
|
# A config is commented out
|
||||||
|
@ -361,7 +362,6 @@ statusFunc() {
|
||||||
"${PI_HOLE_BIN_DIR}"/pihole enable
|
"${PI_HOLE_BIN_DIR}"/pihole enable
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tailFunc() {
|
tailFunc() {
|
||||||
|
|
Loading…
Reference in a new issue