mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 10:43:55 +00:00
Set up for IP matching in detection.
This commit is contained in:
parent
2aa3a109a0
commit
053b38e0bd
1 changed files with 7 additions and 11 deletions
|
@ -189,10 +189,13 @@ ipv6_check() {
|
||||||
|
|
||||||
ip_check() {
|
ip_check() {
|
||||||
local protocol=${1}
|
local protocol=${1}
|
||||||
|
local gravity=${2}
|
||||||
|
|
||||||
local ip_addr_list="$(ip -${protocol} addr show dev ${PIHOLE_INTERFACE} | awk -F ' ' '{ for(i=1;i<=NF;i++) if ($i ~ '/^inet/') print $(i+1) }')"
|
local ip_addr_list="$(ip -${protocol} addr show dev ${PIHOLE_INTERFACE} | awk -F ' ' '{ for(i=1;i<=NF;i++) if ($i ~ '/^inet/') print $(i+1) }')"
|
||||||
if [[ -n ${ip_addr_list} ]]; then
|
if [[ -n ${ip_addr_list} ]]; then
|
||||||
log_write "IPv${protocol} on ${PIHOLE_INTERFACE}"
|
log_write "IPv${protocol} on ${PIHOLE_INTERFACE}"
|
||||||
|
log_write "Gravity configured for: ${2:-NOT CONFIGURED}"
|
||||||
|
log_write "----"
|
||||||
log_write "${ip_addr_list}"
|
log_write "${ip_addr_list}"
|
||||||
echo "::: IPv${protocol} addresses located on ${PIHOLE_INTERFACE}"
|
echo "::: IPv${protocol} addresses located on ${PIHOLE_INTERFACE}"
|
||||||
ip_ping_check ${protocol}
|
ip_ping_check ${protocol}
|
||||||
|
@ -204,7 +207,6 @@ ip_check() {
|
||||||
}
|
}
|
||||||
|
|
||||||
ip_ping_check() {
|
ip_ping_check() {
|
||||||
|
|
||||||
local protocol=${1}
|
local protocol=${1}
|
||||||
local cmd
|
local cmd
|
||||||
|
|
||||||
|
@ -234,19 +236,12 @@ ip_ping_check() {
|
||||||
echo "Query responded."
|
echo "Query responded."
|
||||||
log_write "${ping_inet}"
|
log_write "${ping_inet}"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
log_echo " No gateway detected."
|
||||||
fi
|
fi
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
ip_check_wrapper() {
|
|
||||||
header_write "IP Address Information"
|
|
||||||
|
|
||||||
if ipv6_check; then
|
|
||||||
ip_check "6"
|
|
||||||
fi
|
|
||||||
ip_check "4"
|
|
||||||
}
|
|
||||||
|
|
||||||
port_check() {
|
port_check() {
|
||||||
local lsof_value
|
local lsof_value
|
||||||
|
|
||||||
|
@ -357,7 +352,8 @@ distro_check || echo "Distro Check soft fail"
|
||||||
# Gather processor type
|
# Gather processor type
|
||||||
processor_check || echo "Processor Check soft fail"
|
processor_check || echo "Processor Check soft fail"
|
||||||
|
|
||||||
ip_check_wrapper
|
ip_check 6 ${IPV6_ADDRESS}
|
||||||
|
ip_check 4 ${IPV4_ADDRESS}
|
||||||
|
|
||||||
daemon_check lighttpd http
|
daemon_check lighttpd http
|
||||||
daemon_check dnsmasq domain
|
daemon_check dnsmasq domain
|
||||||
|
|
Loading…
Reference in a new issue