diff options
author | Christian Hesse <mail@eworm.de> | 2020-05-26 23:33:49 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2020-05-26 23:33:49 +0200 |
commit | b7172b69cee46cf9e001918333855e9b79aa15e0 (patch) | |
tree | 1d1365102ec0d48c32d600af89faaa27d1706a77 | |
parent | 856c879fd8cccc2f8dc7243b60233efd1453e22d (diff) |
global-functions: add $DNSIsResolving
-rw-r--r-- | global-functions | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/global-functions b/global-functions index 2ff1f43..d7ee6b8 100644 --- a/global-functions +++ b/global-functions @@ -24,6 +24,7 @@ :global CleanFilePath; :global DefaultRouteIsReachable; :global DeviceInfo; +:global DNSIsResolving; :global DownloadPackage; :global GetMacVendor; :global GetRandom; @@ -218,6 +219,16 @@ :return $Info; } +# check if DNS is resolving +:set DNSIsResolving do={ + :do { + :resolve mikrotik.com; + :return true; + } on-error={ + :return false; + } +} + # download package from upgrade server :set DownloadPackage do={ :local PkgName [ :tostr $1 ]; |