mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-25 13:24:29 +02:00
global-functions: introduce $TimeIsSync
This commit is contained in:
parent
4984b4fd51
commit
77ec3293f0
1 changed files with 16 additions and 0 deletions
|
@ -35,6 +35,7 @@
|
|||
:global DeviceInfo;
|
||||
:global ScriptInstallUpdate;
|
||||
:global MailServerIsUp;
|
||||
:global TimeIsSync;
|
||||
|
||||
# url encoding
|
||||
:set UrlEncode do={
|
||||
|
@ -458,3 +459,18 @@
|
|||
|
||||
: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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue