mod/bridge-port-vlan: move reenable to correct level

This commit is contained in:
Christian Hesse 2022-06-15 09:59:22 +02:00
parent e9f00df290
commit 5b3b3e182b

View file

@ -15,9 +15,9 @@
:global LogPrintExit2; :global LogPrintExit2;
:global ParseKeyValueStore; :global ParseKeyValueStore;
:local InterfaceReEnable [ :toarray "" ];
:foreach BridgePort in=[ /interface/bridge/port/find where !(comment=[]) ] do={ :foreach BridgePort in=[ /interface/bridge/port/find where !(comment=[]) ] do={
:local BridgePortVal [ /interface/bridge/port/get $BridgePort ]; :local BridgePortVal [ /interface/bridge/port/get $BridgePort ];
:local InterfaceReEnable [ :toarray "" ];
:foreach Config,Vlan in=[ $ParseKeyValueStore ($BridgePortVal->"comment") ] do={ :foreach Config,Vlan in=[ $ParseKeyValueStore ($BridgePortVal->"comment") ] do={
:if ($Config = $ConfigTo) do={ :if ($Config = $ConfigTo) do={
:local DHCPClient [ /ip/dhcp-client/find where interface=$BridgePortVal->"interface" comment="toggle with bridge port" ]; :local DHCPClient [ /ip/dhcp-client/find where interface=$BridgePortVal->"interface" comment="toggle with bridge port" ];
@ -61,11 +61,11 @@
} }
} }
} }
:if ([ :len $InterfaceReEnable ] > 0) do={ }
:delay 2s; :if ([ :len $InterfaceReEnable ] > 0) do={
:foreach Interface in=$InterfaceReEnable do={ :delay 2s;
/interface/ethernet/enable [ find where name=$Interface ]; :foreach Interface in=$InterfaceReEnable do={
} /interface/ethernet/enable [ find where name=$Interface ];
} }
} }
} }