From 6e15f791d84eaab785ac233670c4d2bdb7172430 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 25 Sep 2017 14:54:23 +0100 Subject: [PATCH] Different way of trapping ipv6 address error --- src/freedombone-controlpanel | 4 +--- src/freedombone-utils-network | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/freedombone-controlpanel b/src/freedombone-controlpanel index cc126b91..db4ae9c8 100755 --- a/src/freedombone-controlpanel +++ b/src/freedombone-controlpanel @@ -522,9 +522,7 @@ function show_ip_addresses { echo -n "IPv4: $(get_ipv4_address)/$(get_external_ipv4_address)" ipv6_address="$(get_ipv6_address)" if [ ${#ipv6_address} -gt 0 ]; then - if [[ "$ipv6_address" != *'unreachable'* ]]; then - echo " IPv6: ${ipv6_address}" - fi + echo " IPv6: ${ipv6_address}" fi echo '' echo '' diff --git a/src/freedombone-utils-network b/src/freedombone-utils-network index 51c3b4d7..9812a9b8 100755 --- a/src/freedombone-utils-network +++ b/src/freedombone-utils-network @@ -81,7 +81,8 @@ function get_ipv4_address { } function get_ipv6_address { - echo $(ip -6 route get $IPV6_ADDRESS_TEST_DESTINATION | awk -F " " '{ for(i=1;i<=NF;i++) if ($i == "src") print $(i+1) }') + retval=$(ip -6 route get $IPV6_ADDRESS_TEST_DESTINATION 2> /dev/null) + echo $(echo "$retval" | awk -F " " '{ for(i=1;i<=NF;i++) if ($i == "src") print $(i+1) }') } # NOTE: deliberately no exit 0