global-functions: rename internal function: $DefaultRouteIsReachable -> $IsDefaultRouteReachable

This commit is contained in:
Christian Hesse 2022-06-17 00:17:26 +02:00
parent f628ef73fd
commit 0ee38a4303

View file

@ -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;
}
}