aboutsummaryrefslogtreecommitdiffstats
path: root/rotate-ntp
diff options
context:
space:
mode:
Diffstat (limited to 'rotate-ntp')
-rw-r--r--rotate-ntp9
1 files changed, 8 insertions, 1 deletions
diff --git a/rotate-ntp b/rotate-ntp
index 2a095f8..73b9d8a 100644
--- a/rotate-ntp
+++ b/rotate-ntp
@@ -11,6 +11,7 @@
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
:global NtpPool;
+:global RotateNtpResolveFailed;
:global LogPrintExit2;
@@ -24,8 +25,14 @@
:do {
:set Ntp1 [ :resolve ("0." . $NtpPool) ];
:set Ntp2 [ :resolve ("1." . $NtpPool) ];
+ :set RotateNtpResolveFailed false;
} on-error={
- $LogPrintExit2 warning $0 ("Resolving NTP server failed.") true;
+ :if ($RotateNtpResolveFailed != true) do={
+ :set RotateNtpResolveFailed true;
+ $LogPrintExit2 warning $0 ("Resolving NTP server failed.") true;
+ } else={
+ $LogPrintExit2 debug $0 ("Resolving NTP server failed.") true;
+ }
}
$LogPrintExit2 info $0 ("Updating NTP servers to " . $Ntp1 . " and " . $Ntp2) false;