diff options
-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 ]; + } } } |