aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bridge-port-to-default8
1 files changed, 5 insertions, 3 deletions
diff --git a/bridge-port-to-default b/bridge-port-to-default
index 3abb1f3..b273723 100644
--- a/bridge-port-to-default
+++ b/bridge-port-to-default
@@ -4,13 +4,15 @@
#
# reset bridge ports to default bridge
-# delay for global-config
-:delay 1s;
-
:global "bridge-port-to";
: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 comment in=[ :toarray [ / interface bridge port get $interface comment ] ] do={
:if ([ :pick $comment 0 $len ] = ($"bridge-port-to" . ":")) do={