aboutsummaryrefslogtreecommitdiffstats
path: root/bridge-port-to-default
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2020-03-03 13:32:00 +0100
committerGravatar Christian Hesse <mail@eworm.de>2020-03-03 13:32:00 +0100
commit628ae1bd7098a4a898bf3fef0c202ae735014bec (patch)
tree13951ca4552be51c4621a60c5d1ed4dca9843af5 /bridge-port-to-default
parent4ccdec602ed668d50212177f31cea5bdf2b20ed2 (diff)
bridge-port-to-default: use $ParseKeyValueStore...change-13
... 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"
Diffstat (limited to 'bridge-port-to-default')
-rw-r--r--bridge-port-to-default8
1 files changed, 4 insertions, 4 deletions
diff --git a/bridge-port-to-default b/bridge-port-to-default
index 5b3af53..bc6b4b1 100644
--- a/bridge-port-to-default
+++ b/bridge-port-to-default
@@ -7,12 +7,12 @@
:global BridgePortTo;
: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 ];
- :foreach Comment in=[ :toarray ($BridgePortVal->"comment") ] do={
- :if ([ :pick $Comment 0 $Len ] = ($BridgePortTo . ":")) do={
- :local BridgeDefault [ :pick $Comment $Len [ :len $Comment ] ];
+ :foreach Config,BridgeDefault in=[ $ParseKeyValueStore ($BridgePortVal->"comment") ] do={
+ :if ($Config = $BridgePortTo) do={
:if ($BridgeDefault = "dhcp-client") do={
:if ($BridgePortVal->"disabled" = false) do={
$LogPrintExit info ("Disabling bridge port for interface " . $BridgePortVal->"interface" . ", enabling dhcp client.") false;