From 053b38e0bd16cdb57a69fbce15a2fffeaf14b588 Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Thu, 16 Feb 2017 19:45:44 -0800 Subject: [PATCH] Set up for IP matching in detection. --- advanced/Scripts/piholeDebug.sh | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 2733aeaa..1415d975 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -189,10 +189,13 @@ ipv6_check() { ip_check() { 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) }')" if [[ -n ${ip_addr_list} ]]; then log_write "IPv${protocol} on ${PIHOLE_INTERFACE}" + log_write "Gravity configured for: ${2:-NOT CONFIGURED}" + log_write "----" log_write "${ip_addr_list}" echo "::: IPv${protocol} addresses located on ${PIHOLE_INTERFACE}" ip_ping_check ${protocol} @@ -204,7 +207,6 @@ ip_check() { } ip_ping_check() { - local protocol=${1} local cmd @@ -234,19 +236,12 @@ ip_ping_check() { echo "Query responded." log_write "${ping_inet}" fi + else + log_echo " No gateway detected." fi return 0 } -ip_check_wrapper() { - header_write "IP Address Information" - - if ipv6_check; then - ip_check "6" - fi - ip_check "4" -} - port_check() { local lsof_value @@ -357,7 +352,8 @@ distro_check || echo "Distro Check soft fail" # Gather processor type 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 dnsmasq domain