aboutsummaryrefslogtreecommitdiffstats
path: root/fw-addr-lists.rsc
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-03-08 17:32:12 +0100
committerGravatar Christian Hesse <mail@eworm.de>2024-03-12 20:37:57 +0100
commitba2df80f073caf6b426def177b217d1b37954d7f (patch)
tree5dadd74e56ded840e62e82127a9315c8769bfd83 /fw-addr-lists.rsc
parent19802c0b6977f9467fada4ace3cab017dd98964b (diff)
parent242ecef012f5208b6fa088a1222d0d5477e5b2ed (diff)
Merge branch 'LogPrint' into next
Diffstat (limited to 'fw-addr-lists.rsc')
-rw-r--r--fw-addr-lists.rsc26
1 files changed, 13 insertions, 13 deletions
diff --git a/fw-addr-lists.rsc b/fw-addr-lists.rsc
index 4ec4105..64233ac 100644
--- a/fw-addr-lists.rsc
+++ b/fw-addr-lists.rsc
@@ -20,7 +20,7 @@
:global CertificateAvailable;
:global EitherOr;
- :global LogPrintExit2;
+ :global LogPrint;
:global LogPrintOnce;
:global ScriptLock;
:global WaitFullyConnected;
@@ -57,7 +57,7 @@
:if ([ :len ($List->"cert") ] > 0) do={
:set CheckCertificate "yes-without-crl";
:if ([ $CertificateAvailable ($List->"cert") ] = false) do={
- $LogPrintExit2 warning $ScriptName ("Downloading required certificate failed, trying anyway.") false;
+ $LogPrint warning $ScriptName ("Downloading required certificate failed, trying anyway.");
}
}
@@ -68,7 +68,7 @@
http-header-field=({ $FetchUserAgent }) ($List->"url") as-value ]->"data");
} on-error={
:if ($I < 4) do={
- $LogPrintExit2 debug $ScriptName ("Failed downloading, " . $I . ". try: " . $List->"url") false;
+ $LogPrint debug $ScriptName ("Failed downloading, " . $I . ". try: " . $List->"url");
:delay (($I * $I) . "s");
}
}
@@ -78,7 +78,7 @@
:if ($Data = false) do={
:set Data "";
:set Failure true;
- $LogPrintExit2 warning $ScriptName ("Failed downloading list from: " . $List->"url") false;
+ $LogPrint warning $ScriptName ("Failed downloading list from: " . $List->"url");
}
:if ([ :len $Data ] > 63000) do={
@@ -103,13 +103,13 @@
:foreach Entry in=[ /ip/firewall/address-list/find where list=$FwListName comment=$ListComment ] do={
:local Address [ /ip/firewall/address-list/get $Entry address ];
:if ([ :typeof ($IPv4Addresses->$Address) ] = "time") do={
- $LogPrintExit2 debug $ScriptName ("Renewing IPv4 address for " . ($IPv4Addresses->$Address) . ": " . $Address) false;
+ $LogPrint debug $ScriptName ("Renewing IPv4 address for " . ($IPv4Addresses->$Address) . ": " . $Address);
/ip/firewall/address-list/set $Entry timeout=($IPv4Addresses->$Address);
:set ($IPv4Addresses->$Address);
:set CntRenew ($CntRenew + 1);
} else={
:if ($Failure = false) do={
- $LogPrintExit2 debug $ScriptName ("Removing IPv4 address: " . $Address) false;
+ $LogPrint debug $ScriptName ("Removing IPv4 address: " . $Address);
/ip/firewall/address-list/remove $Entry;
:set CntRemove ($CntRemove + 1);
}
@@ -119,13 +119,13 @@
:foreach Entry in=[ /ipv6/firewall/address-list/find where list=$FwListName comment=$ListComment ] do={
:local Address [ /ipv6/firewall/address-list/get $Entry address ];
:if ([ :typeof ($IPv6Addresses->$Address) ] = "time") do={
- $LogPrintExit2 debug $ScriptName ("Renewing IPv6 address for " . ($IPv6Addresses->$Address) . ": " . $Address) false;
+ $LogPrint debug $ScriptName ("Renewing IPv6 address for " . ($IPv6Addresses->$Address) . ": " . $Address);
/ipv6/firewall/address-list/set $Entry timeout=($IPv6Addresses->$Address);
:set ($IPv6Addresses->$Address);
:set CntRenew ($CntRenew + 1);
} else={
:if ($Failure = false) do={
- $LogPrintExit2 debug $ScriptName ("Removing: " . $Address) false;
+ $LogPrint debug $ScriptName ("Removing: " . $Address);
/ipv6/firewall/address-list/remove $Entry;
:set CntRemove ($CntRemove + 1);
}
@@ -133,27 +133,27 @@
}
:foreach Address,Timeout in=$IPv4Addresses do={
- $LogPrintExit2 debug $ScriptName ("Adding IPv4 address for " . $Timeout . ": " . $Address) false;
+ $LogPrint debug $ScriptName ("Adding IPv4 address for " . $Timeout . ": " . $Address);
:do {
/ip/firewall/address-list/add list=$FwListName comment=$ListComment address=$Address timeout=$Timeout;
:set ($IPv4Addresses->$Address);
:set CntAdd ($CntAdd + 1);
} on-error={
- $LogPrintExit2 warning $ScriptName ("Failed to add IPv4 address " . $Address . " to list '" . $FwListName . "'.") false;
+ $LogPrint warning $ScriptName ("Failed to add IPv4 address " . $Address . " to list '" . $FwListName . "'.");
}
}
:foreach Address,Timeout in=$IPv6Addresses do={
- $LogPrintExit2 debug $ScriptName ("Adding IPv6 address for " . $Timeout . ": " . $Address) false;
+ $LogPrint debug $ScriptName ("Adding IPv6 address for " . $Timeout . ": " . $Address);
:do {
/ipv6/firewall/address-list/add list=$FwListName comment=$ListComment address=$Address timeout=$Timeout;
:set ($IPv6Addresses->$Address);
:set CntAdd ($CntAdd + 1);
} on-error={
- $LogPrintExit2 warning $ScriptName ("Failed to add IPv6 address " . $Address . " to list '" . $FwListName . "'.") false;
+ $LogPrint warning $ScriptName ("Failed to add IPv6 address " . $Address . " to list '" . $FwListName . "'.");
}
}
- $LogPrintExit2 info $ScriptName ("list: " . $FwListName . " -- added: " . $CntAdd . " - renewed: " . $CntRenew . " - removed: " . $CntRemove) false;
+ $LogPrint info $ScriptName ("list: " . $FwListName . " -- added: " . $CntAdd . " - renewed: " . $CntRenew . " - removed: " . $CntRemove);
}
} on-error={ }