From b6c0ff80b608076e0e61094bf20f5b89f57c8501 Mon Sep 17 00:00:00 2001 From: prpr Date: Sun, 24 Apr 2022 17:37:13 +0100 Subject: [PATCH] Don't error on null SMART status --- webif/include/diskcheck.jim | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/webif/include/diskcheck.jim b/webif/include/diskcheck.jim index d872915..fb6c3f2 100755 --- a/webif/include/diskcheck.jim +++ b/webif/include/diskcheck.jim @@ -19,15 +19,15 @@ proc {system disksmarterror} {sa count ack_count} { proc {system disksmart} {} { set smartmsg "" - + set smartattrs {realloc pending offline spinretry} - + set smartattribs(SMART_status) "Unknown" foreach sa $smartattrs { set smartattribs(SMART_$sa) 0 set smartattribs(SMART_ack_$sa) 0 } - + foreach line [[settings] smartdata] { lassign $line x name x n x t if {$name eq "SMART_status"} { @@ -36,15 +36,16 @@ proc {system disksmart} {} { set smartattribs($name) $n } } - + # (SMART_ack_status 0 SMART_ack_pending 0 SMART_status PASSED SMART_pending 7 SMART_ack_realloc 0 SMART_ack_offline 0 SMART_realloc 0 SMART_offline 7) - + if {$smartattribs(SMART_status) ne "PASSED" && - $smartattribs(SMART_status) ne "Unknown"} { + $smartattribs(SMART_status) ne "Unknown" && + $smartattribs(SMART_status) ne ""} { append smartmsg \ "Disk overall health assessment is: $smartattribs(SMART_status)\n" } - + foreach sa $smartattrs { set count $smartattribs(SMART_$sa) set ack_count $smartattribs(SMART_ack_$sa)