aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-03-08 12:45:38 +0100
committerGravatar Christian Hesse <mail@eworm.de>2024-03-12 20:37:57 +0100
commitb7983d18c41d61746671a55ec2b9795eba8477bc (patch)
tree8b5ddc7c9625157166b90357262313eac937792a
parentf8c79abd382a3859297f87071a0836d6d9480bdc (diff)
mod/bridge-port-to: switch to $LogPrint
-rw-r--r--mod/bridge-port-to.rsc19
1 files changed, 10 insertions, 9 deletions
diff --git a/mod/bridge-port-to.rsc b/mod/bridge-port-to.rsc
index a78f31b..441094f 100644
--- a/mod/bridge-port-to.rsc
+++ b/mod/bridge-port-to.rsc
@@ -12,7 +12,7 @@
:local BridgePortTo [ :tostr $1 ];
:global IfThenElse;
- :global LogPrintExit2;
+ :global LogPrint;
:global ParseKeyValueStore;
:local InterfaceReEnable ({});
@@ -24,21 +24,22 @@
: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;
+ $LogPrint warning $0 ([ $IfThenElse ([ :len $DHCPClient ] = 0) "Missing" "Duplicate" ] . \
+ " dhcp client configuration for interface " . $BridgePortVal->"interface" . "!");
+ :error false;
}
: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;
+ $LogPrint info $0 ("Disabling bridge port for interface " . $BridgePortVal->"interface" . ", enabling dhcp client.");
/interface/bridge/port/disable $BridgePort;
:delay 200ms;
/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;
+ $LogPrint info $0 ("Enabling bridge port for interface " . $BridgePortVal->"interface" . ", changing to " . $BridgePortTo . \
+ " bridge " . $BridgeDefault . ", disabling dhcp client.");
:if ([ :len $DHCPClient ] = 1) do={
/ip/dhcp-client/disable $DHCPClient;
:delay 200ms;
@@ -50,8 +51,8 @@
}
/interface/bridge/port/set disabled=no bridge=$BridgeDefault $BridgePort;
} else={
- $LogPrintExit2 debug $0 ("Interface " . $BridgePortVal->"interface" . " already connected to " . $BridgePortTo . \
- " bridge " . $BridgeDefault . ".") false;
+ $LogPrint debug $0 ("Interface " . $BridgePortVal->"interface" . " already connected to " . $BridgePortTo . \
+ " bridge " . $BridgeDefault . ".");
}
}
}
@@ -59,7 +60,7 @@
}
:if ([ :len $InterfaceReEnable ] > 0) do={
:delay 5s;
- $LogPrintExit2 info $0 ("Re-enabling interfaces...") false;
+ $LogPrint info $0 ("Re-enabling interfaces...");
/interface/ethernet/enable $InterfaceReEnable;
}
}