From 5fab77abad6f4d4cc78118e57aff64b56abc85a4 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 24 Feb 2020 11:36:36 +0100 Subject: global-functions: introduce $WaitTimeSync --- global-functions | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/global-functions b/global-functions index 0e1530c..73a6d37 100644 --- a/global-functions +++ b/global-functions @@ -36,6 +36,7 @@ :global ScriptInstallUpdate; :global MailServerIsUp; :global TimeIsSync; +:global WaitTimeSync; # url encoding :set UrlEncode do={ @@ -474,3 +475,12 @@ :return false; } + +# wait for time to become synced +:set WaitTimeSync do={ + :global TimeIsSync; + + :while ([ $TimeIsSync ] = false) do={ + :delay 1s; + } +} -- cgit v1.2.3-54-g00ecf