aboutsummaryrefslogtreecommitdiffstats
path: root/global-functions
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2020-04-22 22:20:42 +0200
committerGravatar Christian Hesse <mail@eworm.de>2020-04-22 22:20:42 +0200
commit999763a263ab3c1847b2cafa9dca0c11a0c91573 (patch)
tree4430588d50aa6ef9923754042102e1624850b9e4 /global-functions
parentd6ce774fd8abeeca9c2ee30f810cde527ba902b0 (diff)
global-functions: add $DefaultRouteIsReachable
Diffstat (limited to 'global-functions')
-rw-r--r--global-functions9
1 files changed, 9 insertions, 0 deletions
diff --git a/global-functions b/global-functions
index d18a859..5d059fe 100644
--- a/global-functions
+++ b/global-functions
@@ -22,6 +22,7 @@
:global CertificateNameByCN;
:global CharacterReplace;
:global CleanFilePath;
+:global DefaultRouteIsReachable;
:global DeviceInfo;
:global DownloadPackage;
:global GetMacVendor;
@@ -164,6 +165,14 @@
:return $Path;
}
+# default route is reachable
+:set DefaultRouteIsReachable do={
+ :if ([ / ip route print count-only where dst-address=0.0.0.0/0 !unreachable active !routing-mark ] > 0) do={
+ :return true;
+ }
+ :return false;
+}
+
# get readable device info
:set DeviceInfo do={
:global ExpectedConfigVersion;