mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-25 13:24:29 +02:00
bridge-port-to-default: use $ParseKeyValueStore...
... and unbreak last commit removing delay (69352c90
).
This requires a change in configuration syntax. Change this...
comment="default:br-local, alt:br-guest"
to...
comment="default=br-local, alt=br-guest"
This commit is contained in:
parent
4ccdec602e
commit
628ae1bd70
5 changed files with 8 additions and 7 deletions
|
@ -7,12 +7,12 @@
|
||||||
:global BridgePortTo;
|
:global BridgePortTo;
|
||||||
|
|
||||||
:global LogPrintExit;
|
:global LogPrintExit;
|
||||||
|
:global ParseKeyValueStore;
|
||||||
|
|
||||||
: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 ];
|
||||||
:foreach Comment in=[ :toarray ($BridgePortVal->"comment") ] do={
|
:foreach Config,BridgeDefault in=[ $ParseKeyValueStore ($BridgePortVal->"comment") ] do={
|
||||||
:if ([ :pick $Comment 0 $Len ] = ($BridgePortTo . ":")) do={
|
:if ($Config = $BridgePortTo) do={
|
||||||
:local BridgeDefault [ :pick $Comment $Len [ :len $Comment ] ];
|
|
||||||
:if ($BridgeDefault = "dhcp-client") do={
|
:if ($BridgeDefault = "dhcp-client") do={
|
||||||
:if ($BridgePortVal->"disabled" = false) do={
|
:if ($BridgePortVal->"disabled" = false) do={
|
||||||
$LogPrintExit info ("Disabling bridge port for interface " . $BridgePortVal->"interface" . ", enabling dhcp client.") false;
|
$LogPrintExit info ("Disabling bridge port for interface " . $BridgePortVal->"interface" . ", enabling dhcp client.") false;
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
# Make sure all configuration properties are up to date and this
|
# Make sure all configuration properties are up to date and this
|
||||||
# value is in sync with value in script 'global-functions'!
|
# value is in sync with value in script 'global-functions'!
|
||||||
:global GlobalConfigVersion 12;
|
:global GlobalConfigVersion 13;
|
||||||
|
|
||||||
# This is used for DNS and backup file.
|
# This is used for DNS and backup file.
|
||||||
:global Domain "example.com";
|
:global Domain "example.com";
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
# Make sure all configuration properties are up to date and this
|
# Make sure all configuration properties are up to date and this
|
||||||
# value is in sync with value in script 'global-functions'!
|
# value is in sync with value in script 'global-functions'!
|
||||||
# Comment or remove to disable change notifications.
|
# Comment or remove to disable change notifications.
|
||||||
:global GlobalConfigVersion 12;
|
:global GlobalConfigVersion 13;
|
||||||
|
|
||||||
# The global-config script is updated by script-updates,
|
# The global-config script is updated by script-updates,
|
||||||
# global-config-overlay becomes an overlay for your changes.
|
# global-config-overlay becomes an overlay for your changes.
|
||||||
|
|
|
@ -15,4 +15,5 @@
|
||||||
10="make health threshold for voltage configurable";
|
10="make health threshold for voltage configurable";
|
||||||
11="introduced function '\$ScriptInstallUpdate' to install new and update existing scripts";
|
11="introduced function '\$ScriptInstallUpdate' to install new and update existing scripts";
|
||||||
12="removed '\$ScriptUpdatesConfigChangesIgnore', comment '\$GlobalConfigVersion' in 'global-config-overlay' to disable change notifications";
|
12="removed '\$ScriptUpdatesConfigChangesIgnore', comment '\$GlobalConfigVersion' in 'global-config-overlay' to disable change notifications";
|
||||||
|
13="configuration for script 'bridge-port-to-default' changed with new syntax in comment";
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
# global functions
|
# global functions
|
||||||
|
|
||||||
# expected configuration version
|
# expected configuration version
|
||||||
:global ExpectedConfigVersion 12;
|
:global ExpectedConfigVersion 13;
|
||||||
|
|
||||||
# global variables not to be changed by user
|
# global variables not to be changed by user
|
||||||
:global Identity [ / system identity get name ];
|
:global Identity [ / system identity get name ];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue