hide 'RTNETLINK answers: Network is unreachable' error message during setup if IPv6 is not available (#1576)
This commit is contained in:
parent
4232a1205c
commit
85e59245fd
1 changed files with 2 additions and 2 deletions
|
@ -127,7 +127,7 @@ function get_default_privateip {
|
|||
if [ "$1" == "6" ]; then target=2001:4860:4860::8888; fi
|
||||
|
||||
# Get the route information.
|
||||
route=$(ip -$1 -o route get $target | grep -v unreachable)
|
||||
route=$(ip -$1 -o route get $target 2>/dev/null | grep -v unreachable)
|
||||
|
||||
# Parse the address out of the route information.
|
||||
address=$(echo $route | sed "s/.* src \([^ ]*\).*/\1/")
|
||||
|
|
Loading…
Reference in a new issue