diff options
author | Christian Hesse <mail@eworm.de> | 2018-11-26 11:12:24 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2018-11-26 11:12:24 +0100 |
commit | cdb85460bd549f20e4ba25f198360fedc9e67db4 (patch) | |
tree | 078ef989663d965e0e2722094e18a9d34b0468e5 | |
parent | 015f8e01b57906b2cb4dad0692c69a53ed5451d3 (diff) |
ip-addr-bridge: ignore bridges without ports
Bridges are used for loopback... Assume we do not want to disable
addresses if the bridge has no ports.
-rw-r--r-- | ip-addr-bridge | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ip-addr-bridge b/ip-addr-bridge index 924bba9..39c2aba 100644 --- a/ip-addr-bridge +++ b/ip-addr-bridge @@ -6,9 +6,11 @@ :foreach bridge in=[ / interface bridge find ] do={ :local brname [ / interface bridge get $bridge name ]; - :if ([ / interface bridge port print count-only where bridge=$brname and inactive=no ] = 0) do={ - / ip address disable [ find where !dynamic interface=$brname ]; - } else={ - / ip address enable [ find where !dynamic interface=$brname ]; + :if ([ / interface bridge port print count-only where bridge=$brname ] > 0) do={ + :if ([ / interface bridge port print count-only where bridge=$brname and inactive=no ] = 0) do={ + / ip address disable [ find where !dynamic interface=$brname ]; + } else={ + / ip address enable [ find where !dynamic interface=$brname ]; + } } } |