diff options
author | Christian Hesse <mail@eworm.de> | 2022-05-10 16:09:42 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2022-05-11 13:48:27 +0200 |
commit | 158aea4756edf1d013a910d3fb06fccd8ac2142f (patch) | |
tree | 9dd7caaafbd820bfe4a397d7664ffb3fba47ff75 /mod | |
parent | 8c5348737024038754314d62f1af13eb007c7132 (diff) |
mod/bridge-port-to: RouterOS v7 path syntax
Diffstat (limited to 'mod')
-rw-r--r-- | mod/bridge-port-to | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/mod/bridge-port-to b/mod/bridge-port-to index d88b1cd..c2ab55b 100644 --- a/mod/bridge-port-to +++ b/mod/bridge-port-to @@ -15,34 +15,34 @@ :global LogPrintExit2; :global ParseKeyValueStore; - :foreach BridgePort in=[ / interface bridge port find where !(comment=[]) ] do={ - :local BridgePortVal [ / interface bridge port get $BridgePort ]; + :foreach BridgePort in=[ /interface/bridge/port/find where !(comment=[]) ] do={ + :local BridgePortVal [ /interface/bridge/port/get $BridgePort ]; :foreach Config,BridgeDefault in=[ $ParseKeyValueStore ($BridgePortVal->"comment") ] do={ :if ($Config = $BridgePortTo) 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" ]; :if ($BridgeDefault = "dhcp-client") do={ :if ([ :len $DHCPClient ] != 1) do={ $LogPrintExit2 warning $0 ([ $IfThenElse ([ :len $DHCPClient ] = 0) "Missing" "Duplicate" ] . \ " dhcp client configuration for interface " . $BridgePortVal->"interface" . "!") true; } - :local DHCPClientDisabled [ / ip dhcp-client get $DHCPClient disabled ]; + :local DHCPClientDisabled [ /ip/dhcp-client/get $DHCPClient disabled ]; :if ($BridgePortVal->"disabled" = false || $DHCPClientDisabled = true) do={ $LogPrintExit2 info $0 ("Disabling bridge port for interface " . $BridgePortVal->"interface" . ", enabling dhcp client.") false; - / interface bridge port disable $BridgePort; + /interface/bridge/port/disable $BridgePort; :delay 200ms; - / ip dhcp-client enable $DHCPClient; + /ip/dhcp-client/enable $DHCPClient; } } else={ :if ($BridgePortVal->"disabled" = true || $BridgeDefault != $BridgePortVal->"bridge") do={ $LogPrintExit2 info $0 ("Enabling bridge port for interface " . $BridgePortVal->"interface" . ", changing to " . $BridgePortTo . \ " bridge " . $BridgeDefault . ", disabling dhcp client.") false; :if ([ :len $DHCPClient ] = 1) do={ - / ip dhcp-client disable $DHCPClient; + /ip/dhcp-client/disable $DHCPClient; :delay 200ms; } - / interface bridge port set disabled=no bridge=$BridgeDefault $BridgePort; + /interface/bridge/port/set disabled=no bridge=$BridgeDefault $BridgePort; } else={ $LogPrintExit2 debug $0 ("Interface " . $BridgePortVal->"interface" . " already connected to " . $BridgePortTo . \ " bridge " . $BridgeDefault . ".") false; |