labs: simplify waiting for interfaces
This patch simplifies the loops used to wait for the interfaces to appear. The names of the interfaces are now also written to the log file. Change-Id: I1356c3ff1731dbca87e1c5353d78428359fe96c3
This commit is contained in:
parent
7b114d3bd9
commit
8c4e60fcbf
@ -174,24 +174,22 @@ until ip netns|grep qdhcp; do
|
||||
done
|
||||
nsdhcp=$(ip netns|grep qdhcp)
|
||||
|
||||
echo -n "Waiting for interfaces qr-*, qg-* in router namespace."
|
||||
while [ : ]; do
|
||||
ifaces=$(sudo ip netns exec "$nsrouter" ip addr)
|
||||
if [[ $ifaces == *:\ qr-* && $ifaces == *:\ qg-* ]]; then
|
||||
echo
|
||||
break
|
||||
fi
|
||||
|
||||
echo -n "Waiting for interface qr-* in router namespace."
|
||||
until sudo ip netns exec "$nsrouter" ip addr|grep -Po "(?<=: )qr-.*(?=:)"; do
|
||||
echo -n "."
|
||||
sleep 1
|
||||
done
|
||||
nsdhcp=$(ip netns|grep qdhcp)
|
||||
|
||||
echo -n "Waiting for interface qg-* in router namespace."
|
||||
until sudo ip netns exec "$nsrouter" ip addr|grep -Po "(?<=: )qg-.*(?=:)"; do
|
||||
echo -n "."
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo -n "Waiting for interface tap* in DHCP namespace."
|
||||
while [ : ]; do
|
||||
ifaces=$(sudo ip netns exec "$nsdhcp" ip addr)
|
||||
if [[ $ifaces == *:\ tap* ]]; then
|
||||
echo
|
||||
break
|
||||
fi
|
||||
until sudo ip netns exec "$nsdhcp" ip addr|grep -Po "(?<=: )tap.*(?=:)"; do
|
||||
echo -n "."
|
||||
sleep 1
|
||||
done
|
||||
|
Loading…
x
Reference in New Issue
Block a user