mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-01-25 22:09:49 +00:00
Cut more verbosity. Prep for lsof
parsing and daemon tests.
This commit is contained in:
parent
f73734acb0
commit
60741298b7
1 changed files with 18 additions and 8 deletions
|
@ -132,7 +132,6 @@ ip_check() {
|
||||||
local IPv4_addr_list="$(ip a | awk -F " " '{ for(i=1;i<=NF;i++) if ($i == "inet") print $(i+1) }')" \
|
local IPv4_addr_list="$(ip a | awk -F " " '{ for(i=1;i<=NF;i++) if ($i == "inet") print $(i+1) }')" \
|
||||||
&& (log_write "${IPv4_addr_list}" && echo "::: IPv4 addresses located") || log_echo "No IPv4 addresses found."
|
&& (log_write "${IPv4_addr_list}" && echo "::: IPv4 addresses located") || log_echo "No IPv4 addresses found."
|
||||||
|
|
||||||
echo "::: Locating default gateway and checking connectivity"
|
|
||||||
local IPv4_def_gateway=$(ip r | grep default | cut -d ' ' -f 3)
|
local IPv4_def_gateway=$(ip r | grep default | cut -d ' ' -f 3)
|
||||||
if [[ $? = 0 ]]; then
|
if [[ $? = 0 ]]; then
|
||||||
echo -n "::: Pinging default IPv4 gateway: "
|
echo -n "::: Pinging default IPv4 gateway: "
|
||||||
|
@ -161,10 +160,10 @@ ip_check() {
|
||||||
echo -n "::: Pinging Internet via IPv6: "
|
echo -n "::: Pinging Internet via IPv6: "
|
||||||
local IPv6_inet_check=$(ping6 -q -W 3 -c 3 -n 2001:4860:4860::8888 -I "${IPv6_interface}"| tail -n3) \
|
local IPv6_inet_check=$(ping6 -q -W 3 -c 3 -n 2001:4860:4860::8888 -I "${IPv6_interface}"| tail -n3) \
|
||||||
&& echo "Query responded." || echo "Query did not respond."
|
&& echo "Query responded." || echo "Query did not respond."
|
||||||
|
log_write "${IPv6_inet_check}"
|
||||||
else
|
else
|
||||||
IPv6_inet_check="No IPv6 Gateway Detected"
|
log_echo="No IPv6 Gateway Detected"
|
||||||
fi
|
fi
|
||||||
log_echo "${IPv6_inet_check}"
|
|
||||||
echo ":::"
|
echo ":::"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -188,18 +187,29 @@ hostnameCheck() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lsof_parse() {
|
||||||
|
# Dummy function for now
|
||||||
|
echo "Dummy function lsof_parse got called"
|
||||||
|
log_echo ${1}
|
||||||
|
}
|
||||||
|
|
||||||
daemon_check() {
|
daemon_check() {
|
||||||
# Check for daemon ${1} on port ${2}
|
# Check for daemon ${1} on port ${2}
|
||||||
header_write "Daemon Port Listening Information"
|
header_write "Daemon Port Listening Information"
|
||||||
|
|
||||||
echo "::: Checking port ${2} for ${1} listener."
|
echo "::: Checking port ${2} for ${1} listener."
|
||||||
local found_daemon=false
|
local found_daemon=false
|
||||||
local ret_Val=$(lsof -i :${2} -FcL) \
|
local lsof_value
|
||||||
&& (echo "::: Port ${2} is in use." && found_daemon=true) \
|
|
||||||
|
if [[ ${IPV6_ENABLED} ]]; then
|
||||||
|
lsof_value=$(lsof -i 6:${2} -FcL) \
|
||||||
|
&& (echo "::: Port ${2} is in use on IPv6." && found_daemon=true && echo "${lsof_value}") \
|
||||||
|| (echo "::: Port ${2} is not in use.")
|
|| (echo "::: Port ${2} is not in use.")
|
||||||
if [[ found_daemon ]]; then
|
|
||||||
log_echo "Temporary holding place for evaluation code ${ret_Val}"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
lsof_value=$(lsof -i 4:${2} -FcL) \
|
||||||
|
&& (echo "::: Port ${2} is in use on IPv4." && found_daemon=true && echo "${lsof_value}") \
|
||||||
|
|| (echo "::: Port ${2} is not in use.")
|
||||||
}
|
}
|
||||||
|
|
||||||
testResolver() {
|
testResolver() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue