aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2022-06-29 12:53:50 +0200
committerGravatar Christian Hesse <mail@eworm.de>2022-06-29 12:53:50 +0200
commitf26fb7c05feb8a56d6c567d67a60ee0229569fd4 (patch)
treee7f6f7db4ebc79c7299f65d43adf989691305c47 /mod
parentba34ee5cda2f9c10b7ce8664d9682a7e04790a51 (diff)
mod/bridge-port-to: do not act on missing interface
Happens on broken configuration or early boot...
Diffstat (limited to 'mod')
-rw-r--r--mod/bridge-port-to7
1 files changed, 5 insertions, 2 deletions
diff --git a/mod/bridge-port-to b/mod/bridge-port-to
index d53283d..efeb02a 100644
--- a/mod/bridge-port-to
+++ b/mod/bridge-port-to
@@ -44,9 +44,12 @@
/ip/dhcp-client/disable $DHCPClient;
:delay 200ms;
}
- /interface/ethernet/disable [ find where name=$BridgePortVal->"interface" ];
+ :local Disable [ /interface/ethernet/find where name=$BridgePortVal->"interface" ];
+ :if ([ :len $Disable ] > 0) do={
+ /interface/ethernet/disable $Disable;
+ :set InterfaceReEnable ($InterfaceReEnable, $BridgePortVal->"interface");
+ }
/interface/bridge/port/set disabled=no bridge=$BridgeDefault $BridgePort;
- :set InterfaceReEnable ($InterfaceReEnable, $BridgePortVal->"interface");
} else={
$LogPrintExit2 debug $0 ("Interface " . $BridgePortVal->"interface" . " already connected to " . $BridgePortTo . \
" bridge " . $BridgeDefault . ".") false;