aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2023-01-20 14:37:50 +0100
committerGravatar Christian Hesse <mail@eworm.de>2023-01-20 23:20:53 +0100
commite9a426a7980d70ec9acfe79ed7b7aae53f8d594d (patch)
tree646274ad3fcb9508bd8cd35c9c347378f92cf1bd
parent6780e1a24ccdefd3a328abe7ca8cef3d4ed57114 (diff)
check-health: silently exit without health readings...
... but after checking CPU load and free RAM.
-rw-r--r--check-health22
1 files changed, 11 insertions, 11 deletions
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 ];