forked from hummypkg/webif
1
0
Fork 0

Fix return code decode from smartctl on self-test logs

This commit is contained in:
prpr 2023-11-20 16:04:03 +00:00
parent 504fbc89f8
commit 3e3f50b501
1 changed files with 6 additions and 2 deletions

View File

@ -191,8 +191,12 @@ puts {
</tr>
}
if {[catch {set msg [exec /bin/smartctl -l selftest $device]}]} {
set msg ""
if {[catch {exec /bin/smartctl -l selftest $device} msg]} {
set rc [lindex $::errorCode 2]
set rc $($rc eq "" ? 1 : [expr {$rc & 7}])
if {$rc} {
set msg ""
}
}
set i 0