tazpanel rev 618

hardware.cgi: add SSD detection
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Nov 02 21:57:05 2017 +0100 (19 months ago)
parents 7b71a8d82755
children 9ecd97ecafa7
files hardware.cgi
line diff
     1.1 --- a/hardware.cgi	Mon Oct 09 17:15:22 2017 +0100
     1.2 +++ b/hardware.cgi	Thu Nov 02 21:57:05 2017 +0100
     1.3 @@ -23,7 +23,9 @@
     1.4  	fdisk -l | fgrep Disk | while read a b c; do
     1.5  		d=${b#/dev/}
     1.6  		d="/sys/block/${d%:}/device"
     1.7 -		[ -d $d ] && echo "$a $b $c, $(cat $d/vendor) $(cat $d/model)"
     1.8 +		t="HD"
     1.9 +		[ "$(cat /sys/block/${d%:}/queue/rotational)" -eq "0" ] && t="SSD"
    1.10 +		[ -d $d ] && echo "$a $b $c, $t $(cat $d/vendor) $(cat $d/model)"
    1.11  		smartctl -a ${b%:} | sed '/^Model/,/^Firmware/!d'
    1.12  	done 2> /dev/null | sed 's/  */ /g'
    1.13  }