From e9a426a7980d70ec9acfe79ed7b7aae53f8d594d Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 20 Jan 2023 14:37:50 +0100 Subject: check-health: silently exit without health readings... ... but after checking CPU load and free RAM. --- check-health | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'check-health') diff --git a/check-health b/check-health index 55ad8ab..a9a9dbf 100644 --- a/check-health +++ b/check-health @@ -33,17 +33,6 @@ :return ($T->0 * 10 + $T->1); } -:if ([ :len [ /system/health/find ] ] = 0) do={ - $LogPrintExit2 error $0 ("Your device does not provide any health values.") true; -} - -:if ([ :typeof $CheckHealthLast ] != "array") do={ - :set CheckHealthLast ({}); -} -:if ([ :typeof $CheckHealthTemperatureNotified ] != "array") do={ - :set CheckHealthTemperatureNotified ({}); -} - $ScriptLock $0; :local Resource [ /system/resource/get ]; @@ -78,6 +67,17 @@ $ScriptLock $0; :set CheckHealthFreeRAMNotified false; } +:if ([ :len [ /system/health/find ] ] = 0) do={ + $LogPrintExit2 debug $0 ("Your device does not provide any health values.") true; +} + +:if ([ :typeof $CheckHealthLast ] != "array") do={ + :set CheckHealthLast ({}); +} +:if ([ :typeof $CheckHealthTemperatureNotified ] != "array") do={ + :set CheckHealthTemperatureNotified ({}); +} + :foreach Voltage in=[ /system/health/find where type="V" ] do={ :local Name [ /system/health/get $Voltage name ]; -- cgit v1.2.3-54-g00ecf