diff --git a/webif/html/diag/disk.jim b/webif/html/diag/disk.jim index 85e22e5..0009904 100755 --- a/webif/html/diag/disk.jim +++ b/webif/html/diag/disk.jim @@ -194,18 +194,14 @@ puts { 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 "" - } + if {$rc} { set msg "" } } set i 0 foreach line [split $msg "\n"] { - regsub -all -- {[[:space:]][[:space:]]+} $line "|" line if {[incr i] < 7} continue - lassign [split $line "|"] id name status remaining when lba - if {[string length $id] > 10} continue - if {$id eq ""} continue + if {[regexp {\s*#\s*(\d+)\s+((?:[\s-]?\w[:;.,]?)+)\s+((?:[\s-]?\w[:;.,]?)+?)\s+(\d\d?%)\s+(\d+)\s+([\d-]\d*)} \ + $line x id name status remaining when lba] == 0} continue puts " $id $name