From cdb85460bd549f20e4ba25f198360fedc9e67db4 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 26 Nov 2018 11:12:24 +0100 Subject: 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. --- ip-addr-bridge | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'ip-addr-bridge') 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 ]; + } } } -- cgit v1.2.3-70-g09d2