From d8d7ace5e54a6fdcc38eeb38ca2da15bb716694f Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 17 Jun 2022 00:10:51 +0200 Subject: global-functions: introduce function $IsFullyConnected --- global-functions | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/global-functions b/global-functions index 9745591..bf9538c 100644 --- a/global-functions +++ b/global-functions @@ -34,6 +34,7 @@ :global IfThenElse; :global IsDefaultRouteReachable; :global IsDNSResolving; +:global IsFullyConnected; :global IsTimeSync; :global LogPrintExit2; :global MkDir; @@ -462,6 +463,24 @@ :return true; } +# check if system is is fully connected (default route reachable, DNS resolving, time sync) +:set IsFullyConnected do={ + :global IsDefaultRouteReachable; + :global IsDNSResolving; + :global IsTimeSync; + + :if ([ $IsDefaultRouteReachable ] = false) do={ + :return false; + } + :if ([ $IsDNSResolving ] = false) do={ + :return false; + } + :if ([ $IsTimeSync ] = false) do={ + :return false; + } + :return true; +} + # check if system time is sync :set IsTimeSync do={ :global LogPrintExit2; -- cgit v1.2.3-54-g00ecf