diff options
author | Christian Hesse <mail@eworm.de> | 2020-10-16 21:35:44 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2020-10-16 21:35:44 +0200 |
commit | 3e72d1ec0bcb1a2d6276fff9408db01f16e7f5d8 (patch) | |
tree | b90c56c9906ef97ef0a4acc16ae29a38a9e65a42 /check-health | |
parent | 8b2df7abd071b75b19df8564cece0a23c18c7894 (diff) |
check-health: give error on messing health values
Diffstat (limited to 'check-health')
-rw-r--r-- | check-health | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/check-health b/check-health index 86df9ea..c27178d 100644 --- a/check-health +++ b/check-health @@ -22,6 +22,10 @@ :local CheckHealthCurrent [ / system health get ]; +:if ([ :len $CheckHealthCurrent ] = 0) do={ + $LogPrintExit error ("Your device does not provide any health values.") true; +} + :foreach Voltage in={ "battery"; "psu1-voltage"; "psu2-voltage"; "voltage" } do={ :if ([ :typeof ($CheckHealthLast->$Voltage) ] = "num" && \ [ :typeof ($CheckHealthCurrent->$Voltage) ] = "num") do={ |