diff options
author | Christian Hesse <mail@eworm.de> | 2022-06-17 00:10:51 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2022-06-20 11:29:49 +0200 |
commit | d8d7ace5e54a6fdcc38eeb38ca2da15bb716694f (patch) | |
tree | 80fbc5409b7cc67fe87e08ed3bd94c68b0f19b07 | |
parent | b1ad89b1b5d387bdde9527d80f62fcb9c5c4d4e1 (diff) |
global-functions: introduce function $IsFullyConnected
-rw-r--r-- | global-functions | 19 |
1 files changed, 19 insertions, 0 deletions
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; |