[ ... 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...
This commit is contained in:
Christian Hesse 2020-08-26 09:23:56 +02:00
parent 92ca31a41d
commit ff5cdc3019
20 changed files with 38 additions and 38 deletions

View file

@ -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 ];