From f73734acb06a4d82db8b38c8f156e13abfce37bc Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Wed, 26 Oct 2016 13:57:57 -0700 Subject: [PATCH] Only check IPv6 Gateway if it exists. --- advanced/Scripts/piholeDebug.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 2e457e31..39431371 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -152,7 +152,7 @@ ip_check() { || log_echo "No IPv6 addresses found." local IPv6_def_gateway=$(ip -6 r | grep default | cut -d ' ' -f 3) - if [[ $? = 0 ]]; then + if [[ $? = 0 ]] && [[ -n ${IPv6_def_gateway} ]]; then echo -n "::: Pinging default IPv6 gateway: " local IPv6_def_gateway_check="$(ping6 -q -W 3 -c 3 -n "${IPv6_def_gateway}" -I "${IPv6_interface}"| tail -n3)" \ && echo "Gateway Responded." || echo "Gateway did not respond." @@ -164,8 +164,7 @@ ip_check() { else IPv6_inet_check="No IPv6 Gateway Detected" fi - log_write "${IPv6_inet_check}" - log_write "" + log_echo "${IPv6_inet_check}" echo ":::" fi }