diff options
author | Christian Hesse <mail@eworm.de> | 2018-10-25 20:48:48 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2018-10-25 20:48:48 +0200 |
commit | b6e2b8c3e42d117ef36071edb5886423d6700ca5 (patch) | |
tree | 8280022fe25c03d3dac3a08509005a22cd349801 /bridge-port-to-default | |
parent | 6b089a14258fa5538f406a657f21d2ad06a492cf (diff) |
bridge-port-to-default: delay only when required
Diffstat (limited to 'bridge-port-to-default')
-rw-r--r-- | bridge-port-to-default | 8 |
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={ |