summaryrefslogtreecommitdiff
path: root/automated
diff options
context:
space:
mode:
authorDan Rue <dan.rue@linaro.org>2017-11-20 14:31:28 +0000
committerLinaro Code Review <review@review.linaro.org>2017-11-20 14:31:28 +0000
commite25d1d9d0ae026ce99af958b6352f30a9516081f (patch)
treecbe65a836648e68eca4d124cd1f4c698820cd3d7 /automated
parent13a84d2a3b952f1061308ad435657956a7bcbf45 (diff)
parent721401ef18d42b9c63acb01fda5c290e5eadfc0f (diff)
Merge "linux: network-basic: cover multiple subnets"
Diffstat (limited to 'automated')
-rwxr-xr-xautomated/linux/network-basic/network-basic.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/automated/linux/network-basic/network-basic.sh b/automated/linux/network-basic/network-basic.sh
index 0c5dd8c..8160074 100755
--- a/automated/linux/network-basic/network-basic.sh
+++ b/automated/linux/network-basic/network-basic.sh
@@ -40,9 +40,9 @@ create_out_dir "${OUTPUT}"
install
# When not specified, test the default interface.
-test -z "${INTERFACE}" && INTERFACE=$(route | grep default | awk '{print $NF}')
-# Get default Route Gateway IP address of a given interface
-GATEWAY=$(ip route list | grep default | awk '{print $3}')
+test -z "${INTERFACE}" && INTERFACE=$(route | grep -m 1 "^default" | awk '{print $NF}')
+# Get Route Gateway IP address of a given interface.
+GATEWAY=$(route | grep -m 1 "^default.*${INTERFACE}$" | awk '{print $2}')
run "netstat -an" "print-network-statistics"
run "ip addr" "list-all-network-interfaces"