From 999763a263ab3c1847b2cafa9dca0c11a0c91573 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 22 Apr 2020 22:20:42 +0200 Subject: global-functions: add $DefaultRouteIsReachable --- global-functions | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'global-functions') 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; -- cgit v1.2.3-54-g00ecf