From d6ce774fd8abeeca9c2ee30f810cde527ba902b0 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 22 Apr 2020 10:08:23 +0200 Subject: global-functions: $TimeIsSync: unbreak with bundled ntp client --- global-functions | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'global-functions') diff --git a/global-functions b/global-functions index 145ec09..d18a859 100644 --- a/global-functions +++ b/global-functions @@ -640,9 +640,16 @@ # 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 ([ / system ntp client get enabled ] = true) do={ + :do { + :if ([ / system ntp client get status ] = "synchronized") do={ + :return true; + } + } on-error={ + :if ([ :typeof [ / system ntp client get last-adjustment ] ] = "time") do={ + :return true; + } + } } :if ([ / ip cloud get update-time ] = true && \ -- cgit v1.2.3-54-g00ecf