aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2022-06-17 00:17:26 +0200
committerGravatar Christian Hesse <mail@eworm.de>2022-06-20 11:29:49 +0200
commit0ee38a4303cb608d716c09b06cd7319ea7c5b398 (patch)
tree3341c440ad1a39618dc0f5224c66293404f825c1
parentf628ef73fd6f5568007d8988ca2106757aff00dc (diff)
global-functions: rename internal function: $DefaultRouteIsReachable -> $IsDefaultRouteReachable
-rw-r--r--global-functions22
1 files changed, 11 insertions, 11 deletions
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;
}
}