From c41d543d811c0a684c45a62b323e6165185cbc4b Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Mon, 26 Sep 2016 18:27:02 -0700 Subject: [PATCH] Handle lack of IPv6 gracefully. --- advanced/Scripts/piholeDebug.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index cccf45d6..f38947b9 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -96,8 +96,12 @@ function ipCheck { echo "::: Writing local IPs to logfile" IPADDR=$(ip a | awk -F " " '{ for(i=1;i<=NF;i++) if ($i == "inet") print $(i+1) }') echo "$IPADDR" >> ${DEBUG_LOG} + IP6ADDR=$(ip a | awk -F " " '{ for(i=1;i<=NF;i++) if ($i == "inet6") print $(i+1) }') + if [ -n "$IP6ADDR" ] + then echo "$IP6ADDR" >> ${DEBUG_LOG} + fi echo >> ${DEBUG_LOG} echo "::: Locating default gateway and checking connectivity"