mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
global-functions: introduce $TimeIsSync
This commit is contained in:
@ -35,6 +35,7 @@
|
|||||||
:global DeviceInfo;
|
:global DeviceInfo;
|
||||||
:global ScriptInstallUpdate;
|
:global ScriptInstallUpdate;
|
||||||
:global MailServerIsUp;
|
:global MailServerIsUp;
|
||||||
|
:global TimeIsSync;
|
||||||
|
|
||||||
# url encoding
|
# url encoding
|
||||||
:set UrlEncode do={
|
:set UrlEncode do={
|
||||||
@ -458,3 +459,18 @@
|
|||||||
|
|
||||||
:return false;
|
:return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# check if system time is sync
|
||||||
|
:set TimeIsSync do={
|
||||||
|
:if ([ / system ntp client get enabled ] = true && \
|
||||||
|
[ / system ntp client get status ] = "synchronized") do={
|
||||||
|
:return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
:if ([ / ip cloud get update-time ] = true && \
|
||||||
|
[ :typeof [ / ip cloud get public-address ] ] = "ip") do={
|
||||||
|
:return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
:return false;
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user