drop script 'rotate-ntp'

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
This commit is contained in:
Christian Hesse 2022-06-14 21:17:01 +02:00
parent 66b7fccd30
commit b3de1fad34
7 changed files with 9 additions and 97 deletions

View file

@ -10,7 +10,7 @@
:local 0 "global-functions";
# expected configuration version
:global ExpectedConfigVersion 80;
:global ExpectedConfigVersion 81;
# global variables not to be changed by user
:global GlobalFunctionsReady false;
@ -1260,14 +1260,6 @@
:global TimeIsSync;
:while ([ $TimeIsSync ] = false) do={
:if ([ :len [ /system/script/find where name="rotate-ntp" ] ] > 0 && \
([ /system/resource/get uptime ] % (180 * 1000000000)) = 0s) do={
:do {
/system/script/run rotate-ntp;
} on-error={
$LogPrintExit2 debug $0 ("Running rotate-ntp failed.") false;
}
}
:delay 1s;
}
}