list_iface(): Skip ifaces in a bonding

BTW, I doubt that this function is in use really.
Should be considered to drop it later.
This commit is contained in:
Mikhail Efremov
2016-03-21 18:37:48 +03:00
parent f636557c22
commit 2ccff10451

View File

@ -648,12 +648,14 @@ list_eth()
done done
} }
# Is this function really used anywhere?
list_iface() list_iface()
{ {
netdev_list| netdev_list|
while read iface; do while read iface; do
[ "$iface" != "lo" ] || continue [ "$iface" != "lo" ] || continue
[ -z "$(netdev_find_bridge "$iface")" ] || continue [ -z "$(netdev_find_bridge "$iface")" ] || continue
[ -z "$(netdev_find_bond "$iface")" ] || continue
local tf="/sys/class/net/$iface/type" local tf="/sys/class/net/$iface/type"
[ ! -f "$tf" ] || [ "$(cat "$tf")" != 801 ] || continue [ ! -f "$tf" ] || [ "$(cat "$tf")" != 801 ] || continue
echo "$iface" 2>/dev/null echo "$iface" 2>/dev/null