aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--global-functions11
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 ];