mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-01-20 07:59:33 +00:00
check-health: early exit with :exit
This commit is contained in:
parent
d8980ffc11
commit
9f7ec88f3d
1 changed files with 3 additions and 6 deletions
|
|
@ -8,7 +8,6 @@
|
|||
# check for RouterOS health state
|
||||
# https://rsc.eworm.de/doc/check-health.md
|
||||
|
||||
:local ExitOK false;
|
||||
:onerror Err {
|
||||
:global GlobalConfigReady; :global GlobalFunctionsReady;
|
||||
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
|
||||
|
|
@ -37,8 +36,7 @@
|
|||
}
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
:exit;
|
||||
}
|
||||
|
||||
:local Resource [ /system/resource/get ];
|
||||
|
|
@ -77,8 +75,7 @@
|
|||
:local Plugins [ /system/script/find where name~"^check-health\\.d/." ];
|
||||
:if ([ :len $Plugins ] = 0) do={
|
||||
$LogPrint debug $ScriptName ("No plugins installed.");
|
||||
:set ExitOK true;
|
||||
:error true;
|
||||
:exit;
|
||||
}
|
||||
|
||||
:global CheckHealthPlugins ({});
|
||||
|
|
@ -106,5 +103,5 @@
|
|||
|
||||
:set CheckHealthPlugins;
|
||||
} do={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
|
||||
:global ExitError; $ExitError false [ :jobname ] $Err;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue