aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2022-06-17 00:18:59 +0200
committerGravatar Christian Hesse <mail@eworm.de>2022-06-20 11:29:49 +0200
commit9aa82316c8926773724e2dde24d58594c96bb832 (patch)
tree0afe8317034c8bbd12e72376fbf715aa67f68406
parent0ee38a4303cb608d716c09b06cd7319ea7c5b398 (diff)
global-functions: rename internal function: $DNSIsResolving -> $IsDNSResolving
-rw-r--r--global-functions30
-rw-r--r--netwatch-notify4
2 files changed, 17 insertions, 17 deletions
diff --git a/global-functions b/global-functions
index 0440c31..79aedb7 100644
--- a/global-functions
+++ b/global-functions
@@ -23,7 +23,6 @@
:global CharacterReplace;
:global CleanFilePath;
:global DeviceInfo;
-:global DNSIsResolving;
:global DownloadPackage;
:global EitherOr;
:global EscapeForRegEx;
@@ -34,6 +33,7 @@
:global HexToNum;
:global IfThenElse;
:global IsDefaultRouteReachable;
+:global IsDNSResolving;
:global LogPrintExit2;
:global MkDir;
:global NotificationFunctions;
@@ -225,18 +225,6 @@
("\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
:set DownloadPackage do={
:local PkgName [ :tostr $1 ];
@@ -462,6 +450,18 @@
: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
:set LogPrintExit2 do={
:local Severity [ :tostr $1 ];
@@ -1217,9 +1217,9 @@
# wait for DNS to resolve
:set WaitDNSResolving do={
- :global DNSIsResolving;
+ :global IsDNSResolving;
- :while ([ $DNSIsResolving ] = false) do={
+ :while ([ $IsDNSResolving ] = false) do={
:delay 1s;
}
}
diff --git a/netwatch-notify b/netwatch-notify
index 47b7fa1..45b0c76 100644
--- a/netwatch-notify
+++ b/netwatch-notify
@@ -12,8 +12,8 @@
:global NetwatchNotify;
-:global DNSIsResolving;
:global IfThenElse;
+:global IsDNSResolving;
:global LogPrintExit2;
:global ParseKeyValueStore;
:global ScriptLock;
@@ -67,7 +67,7 @@ $ScriptLock $0;
}
:if ([ :typeof ($HostInfo->"resolve") ] = "str") do={
- :if ([ $DNSIsResolving ] = true) do={
+ :if ([ $IsDNSResolving ] = true) do={
:do {
:local Resolve [ :resolve ($HostInfo->"resolve") ];
:if ($Resolve != $HostVal->"host") do={