From 3434ea9d79e35f90b605a6397f8091da354be42b Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 30 Jun 2022 08:59:27 +0200 Subject: mod/bridge-port-to: re-enable interfaces by id --- mod/bridge-port-to | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'mod/bridge-port-to') diff --git a/mod/bridge-port-to b/mod/bridge-port-to index efeb02a..ae74824 100644 --- a/mod/bridge-port-to +++ b/mod/bridge-port-to @@ -11,7 +11,6 @@ :set BridgePortTo do={ :local BridgePortTo [ :tostr $1 ]; - :global CharacterReplace; :global IfThenElse; :global LogPrintExit2; :global ParseKeyValueStore; @@ -47,7 +46,7 @@ :local Disable [ /interface/ethernet/find where name=$BridgePortVal->"interface" ]; :if ([ :len $Disable ] > 0) do={ /interface/ethernet/disable $Disable; - :set InterfaceReEnable ($InterfaceReEnable, $BridgePortVal->"interface"); + :set InterfaceReEnable ($InterfaceReEnable, $Disable); } /interface/bridge/port/set disabled=no bridge=$BridgeDefault $BridgePort; } else={ @@ -60,10 +59,7 @@ } :if ([ :len $InterfaceReEnable ] > 0) do={ :delay 2s; - $LogPrintExit2 info $0 ("Re-enabling interfaces: " . \ - [ $CharacterReplace [ :tostr $InterfaceReEnable ] ";" " " ]) false; - :foreach Interface in=$InterfaceReEnable do={ - /interface/ethernet/enable [ find where name=$Interface ]; - } + $LogPrintExit2 info $0 ("Re-enabling interfaces...") false; + /interface/ethernet/enable $InterfaceReEnable; } } -- cgit v1.2.3-70-g09d2