From 96cbb32a4f073e11f264e4a641cb304de49fb435 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 6 May 2025 11:15:15 +0200 Subject: [PATCH] check-health: fail if global functions do not become ready --- check-health.rsc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/check-health.rsc b/check-health.rsc index 75710a0..40ce101 100644 --- a/check-health.rsc +++ b/check-health.rsc @@ -8,11 +8,11 @@ # check for RouterOS health state # https://rsc.eworm.de/doc/check-health.md -:global GlobalFunctionsReady; -:while ($GlobalFunctionsReady != true) do={ :delay 500ms; } - :local ExitOK false; :onerror Err { + :global GlobalFunctionsReady; + :retry { :if ($GlobalFunctionsReady != true) \ + do={ :error ("Global functions not ready."); }; } delay=500ms max=50; :local ScriptName [ :jobname ]; :global CheckHealthCPUUtilization;