From b67712cfe449ee59476e62fa45264a152ca36220 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 22 Apr 2020 22:21:06 +0200 Subject: global-functions: add $WaitDefaultRouteReachable --- global-functions | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'global-functions') diff --git a/global-functions b/global-functions index 5d059fe..686b1fa 100644 --- a/global-functions +++ b/global-functions @@ -40,6 +40,7 @@ :global SendTelegram; :global TimeIsSync; :global UrlEncode; +:global WaitDefaultRouteReachable; :global WaitForFile; :global WaitTimeSync; @@ -694,6 +695,15 @@ :return $Return; } +# wait for default route to be reachable +:set WaitDefaultRouteReachable do={ + :global DefaultRouteIsReachable; + + :while ([ $DefaultRouteIsReachable ] = false) do={ + :delay 1s; + } +} + # wait for file to be available :set WaitForFile do={ :global CleanFilePath; -- cgit v1.2.3-70-g09d2