mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Fix indention_2
Co-authored-by: DL6ER <DL6ER@users.noreply.github.com>
This commit is contained in:
parent
5ef731fc57
commit
4a2f4c1bce
1 changed files with 35 additions and 35 deletions
70
pihole
70
pihole
|
@ -323,43 +323,43 @@ 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
|
||||||
port="$(lsof -Pni UDP -p ${pid} -a | grep -m1 : | awk -F ":" '{print $2}')"
|
port="$(lsof -Pni UDP -p ${pid} -a | grep -m1 : | awk -F ":" '{print $2}')"
|
||||||
listening="$(lsof -Pni:53)"
|
listening="$(lsof -Pni:53)"
|
||||||
if [[ ! -z "$port" ]]; then
|
if [[ ! -z "$port" ]]; then
|
||||||
if [[ "${1}" != "web" ]] && [[ "$port" -eq 53 ]]; then
|
if [[ "${1}" != "web" ]] && [[ "$port" -eq 53 ]]; then
|
||||||
analyze_ports "${listening}"
|
analyze_ports "${listening}"
|
||||||
fi
|
|
||||||
else
|
|
||||||
case "${1}" in
|
|
||||||
"web") echo "-1";;
|
|
||||||
*) echo -e " ${CROSS} DNS service is NOT listening";;
|
|
||||||
esac
|
|
||||||
return 0
|
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
case "${1}" in
|
||||||
|
"web") echo "-1";;
|
||||||
|
*) echo -e " ${CROSS} DNS service is NOT listening";;
|
||||||
|
esac
|
||||||
|
return 0
|
||||||
|
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
|
||||||
case "${1}" in
|
case "${1}" in
|
||||||
"web") echo 0;;
|
"web") echo 0;;
|
||||||
*) echo -e " ${CROSS} Pi-hole blocking is disabled";;
|
*) echo -e " ${CROSS} Pi-hole blocking is disabled";;
|
||||||
esac
|
esac
|
||||||
elif grep -q "BLOCKING_ENABLED=true" /etc/pihole/setupVars.conf; then
|
elif grep -q "BLOCKING_ENABLED=true" /etc/pihole/setupVars.conf; then
|
||||||
# Configs are set
|
# Configs are set
|
||||||
case "${1}" in
|
case "${1}" in
|
||||||
"web") echo "$port";;
|
"web") echo "$port";;
|
||||||
*) echo -e " ${TICK} Pi-hole blocking is enabled";;
|
*) echo -e " ${TICK} Pi-hole blocking is enabled";;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
# No configs were found
|
# No configs were found
|
||||||
case "${1}" in
|
case "${1}" in
|
||||||
"web") echo -2;;
|
"web") echo -2;;
|
||||||
*) echo -e " ${INFO} Pi-hole blocking will be enabled";;
|
*) echo -e " ${INFO} Pi-hole blocking will be enabled";;
|
||||||
esac
|
esac
|
||||||
# Enable blocking
|
# Enable blocking
|
||||||
"${PI_HOLE_BIN_DIR}"/pihole enable
|
"${PI_HOLE_BIN_DIR}"/pihole enable
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue