mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
global-functions: introduce function $IsFullyConnected
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
:global IfThenElse;
|
||||
:global IsDefaultRouteReachable;
|
||||
:global IsDNSResolving;
|
||||
:global IsFullyConnected;
|
||||
:global IsTimeSync;
|
||||
:global LogPrintExit2;
|
||||
:global MkDir;
|
||||
@@ -462,6 +463,24 @@
|
||||
: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
|
||||
:set IsTimeSync do={
|
||||
:global LogPrintExit2;
|
||||
|
Reference in New Issue
Block a user