From 0ee38a4303cb608d716c09b06cd7319ea7c5b398 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 17 Jun 2022 00:17:26 +0200 Subject: global-functions: rename internal function: $DefaultRouteIsReachable -> $IsDefaultRouteReachable --- global-functions | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'global-functions') diff --git a/global-functions b/global-functions index 050045b..0440c31 100644 --- a/global-functions +++ b/global-functions @@ -22,7 +22,6 @@ :global CertificateNameByCN; :global CharacterReplace; :global CleanFilePath; -:global DefaultRouteIsReachable; :global DeviceInfo; :global DNSIsResolving; :global DownloadPackage; @@ -34,6 +33,7 @@ :global GetRandomNumber; :global HexToNum; :global IfThenElse; +:global IsDefaultRouteReachable; :global LogPrintExit2; :global MkDir; :global NotificationFunctions; @@ -183,14 +183,6 @@ :return $Path; } -# default route is reachable -:set DefaultRouteIsReachable do={ - :if ([ :len [ /ip/route/find where dst-address=0.0.0.0/0 active routing-table=main ] ] > 0) do={ - :return true; - } - :return false; -} - # get readable device info :set DeviceInfo do={ :global ExpectedConfigVersion; @@ -462,6 +454,14 @@ :return $3; } +# check if default route is reachable +:set IsDefaultRouteReachable do={ + :if ([ :len [ /ip/route/find where dst-address=0.0.0.0/0 active routing-table=main ] ] > 0) do={ + :return true; + } + :return false; +} + # log and print with same text, optionally exit :set LogPrintExit2 do={ :local Severity [ :tostr $1 ]; @@ -1208,9 +1208,9 @@ # wait for default route to be reachable :set WaitDefaultRouteReachable do={ - :global DefaultRouteIsReachable; + :global IsDefaultRouteReachable; - :while ([ $DefaultRouteIsReachable ] = false) do={ + :while ([ $IsDefaultRouteReachable ] = false) do={ :delay 1s; } } -- cgit v1.2.3-70-g09d2