aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;