From 4166bf91c348a261563087e14cb839e2695b991f Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 26 May 2020 23:34:58 +0200 Subject: global-functions: add $WaitDNSResolving --- global-functions | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/global-functions b/global-functions index d7ee6b8..21e89af 100644 --- a/global-functions +++ b/global-functions @@ -42,6 +42,7 @@ :global TimeIsSync; :global UrlEncode; :global WaitDefaultRouteReachable; +:global WaitDNSResolving; :global WaitForFile; :global WaitTimeSync; @@ -722,6 +723,15 @@ } } +# wait for DNS to resolve +:set WaitDNSResolving do={ + :global DNSIsResolving; + + :while ([ $DNSIsResolving ] = false) do={ + :delay 1s; + } +} + # wait for file to be available :set WaitForFile do={ :global CleanFilePath; -- cgit v1.2.3-54-g00ecf