bridge-port-to-default: delay only when required

This commit is contained in:
Christian Hesse 2018-10-25 20:48:48 +02:00
parent 6b089a1425
commit b6e2b8c3e4

View file

@ -4,13 +4,15 @@
# #
# reset bridge ports to default bridge # reset bridge ports to default bridge
# delay for global-config
:delay 1s;
:global "bridge-port-to"; :global "bridge-port-to";
:local "len" ([ :len $"bridge-port-to" ] + 1); :local "len" ([ :len $"bridge-port-to" ] + 1);
:if ($"len" = 1) do={
:delay 1s;
:set "len" ([ :len $"bridge-port-to" ] + 1);
}
:foreach interface in=[ / interface bridge port find where comment!="" ] do={ :foreach interface in=[ / interface bridge port find where comment!="" ] do={
:foreach comment in=[ :toarray [ / interface bridge port get $interface comment ] ] do={ :foreach comment in=[ :toarray [ / interface bridge port get $interface comment ] ] do={
:if ([ :pick $comment 0 $len ] = ($"bridge-port-to" . ":")) do={ :if ([ :pick $comment 0 $len ] = ($"bridge-port-to" . ":")) do={