From ff5cdc30193ba69944f6772f213e63ea00678861 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 26 Aug 2020 09:23:56 +0200 Subject: [ ... print count-only ...] -> [ :len [ ... find ... ] ] Using 'print count-only' always prints a number to terminal, even if the value is evaluated in a condition or assigned to a variable. This can be quite annoying. Behavior will not chance (SUP-25503), so replacing the code... --- ip-addr-bridge | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ip-addr-bridge') diff --git a/ip-addr-bridge b/ip-addr-bridge index ec403f5..9bc7ef8 100644 --- a/ip-addr-bridge +++ b/ip-addr-bridge @@ -8,8 +8,8 @@ :foreach Bridge in=[ / interface bridge find ] do={ :local BrName [ / interface bridge get $Bridge name ]; - :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={ + :if ([ :len [ / interface bridge port find where bridge=$BrName ] ] > 0) do={ + :if ([ :len [ / interface bridge port find 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