aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2022-06-17 00:10:51 +0200
committerGravatar Christian Hesse <mail@eworm.de>2022-06-20 11:29:49 +0200
commitd8d7ace5e54a6fdcc38eeb38ca2da15bb716694f (patch)
tree80fbc5409b7cc67fe87e08ed3bd94c68b0f19b07
parentb1ad89b1b5d387bdde9527d80f62fcb9c5c4d4e1 (diff)
global-functions: introduce function $IsFullyConnected
-rw-r--r--global-functions19
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;