mirror of
https://github.com/nymurbd/MikroTik-scripts.git
synced 2025-08-01 16:55:03 +02:00
global-functions: rename internal function: $DNSIsResolving -> $IsDNSResolving
This commit is contained in:
parent
0ee38a4303
commit
9aa82316c8
2 changed files with 17 additions and 17 deletions
|
@ -23,7 +23,6 @@
|
||||||
:global CharacterReplace;
|
:global CharacterReplace;
|
||||||
:global CleanFilePath;
|
:global CleanFilePath;
|
||||||
:global DeviceInfo;
|
:global DeviceInfo;
|
||||||
:global DNSIsResolving;
|
|
||||||
:global DownloadPackage;
|
:global DownloadPackage;
|
||||||
:global EitherOr;
|
:global EitherOr;
|
||||||
:global EscapeForRegEx;
|
:global EscapeForRegEx;
|
||||||
|
@ -34,6 +33,7 @@
|
||||||
:global HexToNum;
|
:global HexToNum;
|
||||||
:global IfThenElse;
|
:global IfThenElse;
|
||||||
:global IsDefaultRouteReachable;
|
:global IsDefaultRouteReachable;
|
||||||
|
:global IsDNSResolving;
|
||||||
:global LogPrintExit2;
|
:global LogPrintExit2;
|
||||||
:global MkDir;
|
:global MkDir;
|
||||||
:global NotificationFunctions;
|
:global NotificationFunctions;
|
||||||
|
@ -225,18 +225,6 @@
|
||||||
("\n Expected: " . $ExpectedConfigVersion) ]);
|
("\n Expected: " . $ExpectedConfigVersion) ]);
|
||||||
}
|
}
|
||||||
|
|
||||||
# check if DNS is resolving
|
|
||||||
:set DNSIsResolving do={
|
|
||||||
:global CharacterReplace;
|
|
||||||
|
|
||||||
:do {
|
|
||||||
:resolve "low-ttl.eworm.de";
|
|
||||||
} on-error={
|
|
||||||
:return false;
|
|
||||||
}
|
|
||||||
:return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
# download package from upgrade server
|
# download package from upgrade server
|
||||||
:set DownloadPackage do={
|
:set DownloadPackage do={
|
||||||
:local PkgName [ :tostr $1 ];
|
:local PkgName [ :tostr $1 ];
|
||||||
|
@ -462,6 +450,18 @@
|
||||||
:return false;
|
:return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# check if DNS is resolving
|
||||||
|
:set IsDNSResolving do={
|
||||||
|
:global CharacterReplace;
|
||||||
|
|
||||||
|
:do {
|
||||||
|
:resolve "low-ttl.eworm.de";
|
||||||
|
} on-error={
|
||||||
|
:return false;
|
||||||
|
}
|
||||||
|
:return true;
|
||||||
|
}
|
||||||
|
|
||||||
# log and print with same text, optionally exit
|
# log and print with same text, optionally exit
|
||||||
:set LogPrintExit2 do={
|
:set LogPrintExit2 do={
|
||||||
:local Severity [ :tostr $1 ];
|
:local Severity [ :tostr $1 ];
|
||||||
|
@ -1217,9 +1217,9 @@
|
||||||
|
|
||||||
# wait for DNS to resolve
|
# wait for DNS to resolve
|
||||||
:set WaitDNSResolving do={
|
:set WaitDNSResolving do={
|
||||||
:global DNSIsResolving;
|
:global IsDNSResolving;
|
||||||
|
|
||||||
:while ([ $DNSIsResolving ] = false) do={
|
:while ([ $IsDNSResolving ] = false) do={
|
||||||
:delay 1s;
|
:delay 1s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
|
|
||||||
:global NetwatchNotify;
|
:global NetwatchNotify;
|
||||||
|
|
||||||
:global DNSIsResolving;
|
|
||||||
:global IfThenElse;
|
:global IfThenElse;
|
||||||
|
:global IsDNSResolving;
|
||||||
:global LogPrintExit2;
|
:global LogPrintExit2;
|
||||||
:global ParseKeyValueStore;
|
:global ParseKeyValueStore;
|
||||||
:global ScriptLock;
|
:global ScriptLock;
|
||||||
|
@ -67,7 +67,7 @@ $ScriptLock $0;
|
||||||
}
|
}
|
||||||
|
|
||||||
:if ([ :typeof ($HostInfo->"resolve") ] = "str") do={
|
:if ([ :typeof ($HostInfo->"resolve") ] = "str") do={
|
||||||
:if ([ $DNSIsResolving ] = true) do={
|
:if ([ $IsDNSResolving ] = true) do={
|
||||||
:do {
|
:do {
|
||||||
:local Resolve [ :resolve ($HostInfo->"resolve") ];
|
:local Resolve [ :resolve ($HostInfo->"resolve") ];
|
||||||
:if ($Resolve != $HostVal->"host") do={
|
:if ($Resolve != $HostVal->"host") do={
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue