Small improvement on the default gateway(s) detection

Change-Id: I98cc39bc909b63b57e366cbb787f655097dfe254
This commit is contained in:
Cédric Jeanneret 2020-05-12 10:31:46 +02:00 committed by Cédric Jeanneret (Tengu)
parent f353a65f55
commit 0a27ab493b

View File

@ -59,7 +59,7 @@ function ping_controller_ips() {
# all of them should some manual network config have
# multiple gateways.
function ping_default_gateways() {
DEFAULT_GW=$(ip r | grep ^default | cut -d " " -f 3)
DEFAULT_GW=$(ip ro | awk '/^default/ {print $3}')
set +e
for GW in $DEFAULT_GW; do
echo -n "Trying to ping default gateway ${GW}..."