mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-24 04:44:26 +02:00
fw-addr-lists: retry to download on failure
This commit is contained in:
parent
351c7d31ff
commit
eb3b4d169e
1 changed files with 14 additions and 4 deletions
|
@ -40,8 +40,8 @@ $WaitFullyConnected;
|
|||
:local Failure false;
|
||||
|
||||
:foreach List in=$FwList do={
|
||||
:local Data;
|
||||
:local CheckCertificate "no";
|
||||
:local Data false;
|
||||
|
||||
:if ([ :len ($List->"cert") ] > 0) do={
|
||||
:set CheckCertificate "yes-without-crl";
|
||||
|
@ -50,9 +50,19 @@ $WaitFullyConnected;
|
|||
}
|
||||
}
|
||||
|
||||
:do {
|
||||
:set Data ([ /tool/fetch ($List->"url") check-certificate=$CheckCertificate output=user as-value ]->"data");
|
||||
} on-error={
|
||||
:for I from=2 to=0 do={
|
||||
:if ($Data = false) do={
|
||||
:do {
|
||||
:set Data ([ /tool/fetch ($List->"url") check-certificate=$CheckCertificate output=user as-value ]->"data");
|
||||
} on-error={
|
||||
$LogPrintExit2 debug $0 ("Failed downloading, " . $I . " retries pending: " . $List->"url") false;
|
||||
:delay 2s;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:if ($Data = false) do={
|
||||
:set Data "";
|
||||
:set Failure true;
|
||||
$LogPrintExit2 warning $0 ("Failed downloading list from: " . $List->"url") false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue