From a299a2cc5fb0ac9713287e32271d64ff4cd4ee96 Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Sun, 8 Jan 2017 18:04:24 -0800 Subject: [PATCH] Repetitive `ip route get` was resetting counts. Signed-off-by: Dan Schaper --- automated install/basic-install.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 0307bd2e..37d0f544 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -168,10 +168,13 @@ getGitFiles() { } find_IPv4_information() { + local route # Find IP used to route to outside world - IPv4dev=$(ip route get 8.8.8.8 | awk '{for(i=1;i<=NF;i++)if($i~/dev/)print $(i+1)}') - IPV4_ADDRESS=$(ip route get 8.8.8.8| awk '{print $7}') - IPv4gw=$(ip route get 8.8.8.8 | awk '{print $3}') + route=$(ip route get 8.8.8.8) + IPv4dev=$(awk '{for (i=1; i<=NF; i++) if ($i~/dev/) print $(i+1)}' <<< "${route}") + IPV4_ADDRESS=$(awk '{print $7}' <<< "${route}") + IPv4gw=$(awk '{print $3}' <<< "${route}") + } get_available_interfaces() {