mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-13 19:44:28 +02:00
global-functions: introduce function $IsFullyConnected
This commit is contained in:
parent
b1ad89b1b5
commit
d8d7ace5e5
1 changed files with 19 additions and 0 deletions
|
@ -34,6 +34,7 @@
|
||||||
:global IfThenElse;
|
:global IfThenElse;
|
||||||
:global IsDefaultRouteReachable;
|
:global IsDefaultRouteReachable;
|
||||||
:global IsDNSResolving;
|
:global IsDNSResolving;
|
||||||
|
:global IsFullyConnected;
|
||||||
:global IsTimeSync;
|
:global IsTimeSync;
|
||||||
:global LogPrintExit2;
|
:global LogPrintExit2;
|
||||||
:global MkDir;
|
:global MkDir;
|
||||||
|
@ -462,6 +463,24 @@
|
||||||
:return true;
|
:return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# check if system is is fully connected (default route reachable, DNS resolving, time sync)
|
||||||
|
:set IsFullyConnected do={
|
||||||
|
:global IsDefaultRouteReachable;
|
||||||
|
:global IsDNSResolving;
|
||||||
|
:global IsTimeSync;
|
||||||
|
|
||||||
|
:if ([ $IsDefaultRouteReachable ] = false) do={
|
||||||
|
:return false;
|
||||||
|
}
|
||||||
|
:if ([ $IsDNSResolving ] = false) do={
|
||||||
|
:return false;
|
||||||
|
}
|
||||||
|
:if ([ $IsTimeSync ] = false) do={
|
||||||
|
:return false;
|
||||||
|
}
|
||||||
|
:return true;
|
||||||
|
}
|
||||||
|
|
||||||
# check if system time is sync
|
# check if system time is sync
|
||||||
:set IsTimeSync do={
|
:set IsTimeSync do={
|
||||||
:global LogPrintExit2;
|
:global LogPrintExit2;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue