mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-06-28 04:10:07 +02:00
mod/bridge-port-vlan: re-enable interfaces by id
This commit is contained in:
parent
f26fb7c05f
commit
e27a0166ba
1 changed files with 3 additions and 7 deletions
|
@ -11,7 +11,6 @@
|
|||
:global BridgePortVlan do={
|
||||
:local ConfigTo [ :tostr $1 ];
|
||||
|
||||
:global CharacterReplace;
|
||||
:global IfThenElse;
|
||||
:global LogPrintExit2;
|
||||
:global ParseKeyValueStore;
|
||||
|
@ -55,7 +54,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 pvid=$Vlan $BridgePort;
|
||||
} else={
|
||||
|
@ -68,10 +67,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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue