aboutsummaryrefslogtreecommitdiffstats
path: root/rotate-ntp
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2022-06-14 21:17:01 +0200
committerGravatar Christian Hesse <mail@eworm.de>2022-06-15 16:39:49 +0200
commitb3de1fad3459aa886b3ca3e1f1f91066ab0730b6 (patch)
treeae2eca55b833d01b2d82c526f833a73f9b439578 /rotate-ntp
parent66b7fccd303137d68cf571e79a0ffd7ca82f4b6a (diff)
drop script 'rotate-ntp'change-81
For RouterOS 6.x a separate package 'ntp' exists. This adds server functionality, but allows ip addresses for the client only. I added the script 'rotate-ntp' to update addresses from names... Now with RouterOS 7.x there's no extra package and the limitation does no longer exist. So let's just drop the script. This adds migration code, that... * removes the script from configuration * removes a scheduler from configuration * sets the configured ntp pool name for ntp client
Diffstat (limited to 'rotate-ntp')
-rw-r--r--rotate-ntp39
1 files changed, 1 insertions, 38 deletions
diff --git a/rotate-ntp b/rotate-ntp
index 4446cba..9374129 100644
--- a/rotate-ntp
+++ b/rotate-ntp
@@ -1,39 +1,2 @@
#!rsc by RouterOS
-# RouterOS script: rotate-ntp
-# Copyright (c) 2013-2022 Christian Hesse <mail@eworm.de>
-# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
-#
-# rotate the ntp servers
-# https://git.eworm.de/cgit/routeros-scripts/about/doc/rotate-ntp.md
-
-:local 0 "rotate-ntp";
-:global GlobalFunctionsReady;
-:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
-
-:global NtpPool;
-:global RotateNtpResolveFailed;
-
-:global LogPrintExit2;
-
-:local Ntp1;
-:local Ntp2;
-
-:if ([ /system/ntp/client/get enabled ] != true) do={
- $LogPrintExit2 warning $0 ("NTP client is not enabled!") true;
-}
-
-:do {
- :set Ntp1 [ :resolve ("0." . $NtpPool) ];
- :set Ntp2 [ :resolve ("1." . $NtpPool) ];
- :set RotateNtpResolveFailed false;
-} on-error={
- :if ($RotateNtpResolveFailed != true) do={
- :set RotateNtpResolveFailed true;
- $LogPrintExit2 warning $0 ("Resolving NTP server failed.") true;
- } else={
- $LogPrintExit2 debug $0 ("Resolving NTP server failed, again.") true;
- }
-}
-
-$LogPrintExit2 info $0 ("Updating NTP servers to " . $Ntp1 . " and " . $Ntp2) false;
-/system/ntp/client/set servers=($Ntp1, $Ntp2);
+# dummy for removal