aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Harkin <ryan.harkin@linaro.org>2021-01-09 10:40:54 +0000
committerRyan Harkin <ryan.harkin@linaro.org>2021-01-09 10:40:54 +0000
commite4e34e6f758655eaccf5112284bdd4763a3e392e (patch)
tree9234193ac1eb64727efde6f21953b4ce1ac224a0
parentd1da7c102fcb8e761f3eed65122206e5b757c161 (diff)
if we don't have a route, remove the ipaddrethernet-20210109-001
Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
-rwxr-xr-xautomated/linux/network-test/network-test.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/automated/linux/network-test/network-test.sh b/automated/linux/network-test/network-test.sh
index fd3ec02..57fe9c0 100755
--- a/automated/linux/network-test/network-test.sh
+++ b/automated/linux/network-test/network-test.sh
@@ -314,12 +314,17 @@ do_dhcp(){
sleep 5
echo "Bringing ${interface} up..."
ifconfig "${interface}" up
- sleep 5
+ sleep 10
udhcpc -i "${interface}"
sleep 5
# Get default Route IP address of a given interface
ROUTE_ADDR=$(ip route list | grep default | awk '{print $3}' | head -1)
if [ -z "${ROUTE_ADDR}" ]; then
+ ipaddr=$(get_ipaddr "${interface}")
+ netmask=$(get_netmask "${interface}")
+ if [ ! -z "${ipaddr}" ]; then
+ ip addr del "${ipaddr}"/"${netmask}" dev "${interface}"
+ fi
continue;
fi
;;