diff options
author | Christian Hesse <mail@eworm.de> | 2020-03-03 08:40:16 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2020-03-03 08:54:18 +0100 |
commit | 4ccdec602ed668d50212177f31cea5bdf2b20ed2 (patch) | |
tree | f50ed9c19fc4d7953d3fe61eb9e55d5262920bf7 /bridge-port-to-default | |
parent | 001e7eeb39ee993539334805622f8cd24fde63e9 (diff) |
bridge-port-to-default: use $LogPrintExit
Diffstat (limited to 'bridge-port-to-default')
-rw-r--r-- | bridge-port-to-default | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/bridge-port-to-default b/bridge-port-to-default index 1bb4597..5b3af53 100644 --- a/bridge-port-to-default +++ b/bridge-port-to-default @@ -6,6 +6,8 @@ :global BridgePortTo; +:global LogPrintExit; + :foreach BridgePort in=[ / interface bridge port find where comment!="" ] do={ :local BridgePortVal [ / interface bridge port get $BridgePort ]; :foreach Comment in=[ :toarray ($BridgePortVal->"comment") ] do={ @@ -13,18 +15,18 @@ :local BridgeDefault [ :pick $Comment $Len [ :len $Comment ] ]; :if ($BridgeDefault = "dhcp-client") do={ :if ($BridgePortVal->"disabled" = false) do={ - :log info ("Disabling bridge port for interface " . $BridgePortVal->"interface" . ", enabling dhcp client."); + $LogPrintExit info ("Disabling bridge port for interface " . $BridgePortVal->"interface" . ", enabling dhcp client.") false; / interface bridge port disable $BridgePort; / ip dhcp-client enable [ find where interface=$BridgePortVal->"interface" comment="toggle with bridge port" disabled=yes ]; } } else={ :if ($BridgePortVal->"disabled" = true) do={ - :log info ("Enabling bridge port for interface " . $BridgePortVal->"interface" . ", disabling dhcp client."); + $LogPrintExit info ("Enabling bridge port for interface " . $BridgePortVal->"interface" . ", disabling dhcp client.") false; / ip dhcp-client disable [ find where interface=$BridgePortVal->"interface" comment="toggle with bridge port" disabled=no ]; / interface bridge port enable $BridgePort; } :if ($BridgeDefault != $BridgePortVal->"bridge") do={ - :log info ("Changing interface " . $BridgePortVal->"interface" . " to " . $BridgePortTo . " bridge " . $BridgeDefault); + $LogPrintExit info ("Changing interface " . $BridgePortVal->"interface" . " to " . $BridgePortTo . " bridge " . $BridgeDefault) false; / interface bridge port set bridge=$BridgeDefault $BridgePort; } else={ :log debug ("Interface " . $BridgePortVal->"interface" . " already connected to " . $BridgePortTo . " bridge " . $BridgeDefault); |