aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2020-02-24 11:06:17 +0100
committerGravatar Christian Hesse <mail@eworm.de>2020-02-24 11:06:17 +0100
commit77ec3293f0803eacb7d6684b63f4add68ed767b9 (patch)
tree03d67a7247b66a1f90f3bc4d216186c188be12ee
parent4984b4fd511e3f4f0352d30c37a312ed6884dcb3 (diff)
global-functions: introduce $TimeIsSync
-rw-r--r--global-functions16
1 files changed, 16 insertions, 0 deletions
diff --git a/global-functions b/global-functions
index 7d242e6..0e1530c 100644
--- a/global-functions
+++ b/global-functions
@@ -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;
+}