global-functions: add $DefaultRouteIsReachable

This commit is contained in:
Christian Hesse 2020-04-22 22:20:42 +02:00
parent d6ce774fd8
commit 999763a263

View file

@ -22,6 +22,7 @@
:global CertificateNameByCN; :global CertificateNameByCN;
:global CharacterReplace; :global CharacterReplace;
:global CleanFilePath; :global CleanFilePath;
:global DefaultRouteIsReachable;
:global DeviceInfo; :global DeviceInfo;
:global DownloadPackage; :global DownloadPackage;
:global GetMacVendor; :global GetMacVendor;
@ -164,6 +165,14 @@
:return $Path; :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 # get readable device info
:set DeviceInfo do={ :set DeviceInfo do={
:global ExpectedConfigVersion; :global ExpectedConfigVersion;