# HG changeset patch # User Pascal Bellard # Date 1428334712 -7200 # Node ID b14da4e2d0a6518ad473242bd7d78b4c6d5e0df4 # Parent 958365a41cdb181d6aee4f5925bbbd48e333a9f6 hardware.cgi: show disk model diff -r 958365a41cdb -r b14da4e2d0a6 hardware.cgi --- a/hardware.cgi Mon Apr 06 13:08:02 2015 +0200 +++ b/hardware.cgi Mon Apr 06 17:38:32 2015 +0200 @@ -19,6 +19,13 @@ [ -s $module ] && . $module "$@" } +disk_info() { + fdisk -l | fgrep Disk | while read a b c; do + d=${b#/dev/} + d="/sys/block/${d%:}/device" + [ -d $d ] && echo "$a $b $c, $(cat $d/vendor) $(cat $d/model)" + done 2> /dev/null | sed 's/ */ /g' +} lsusb_table() { cat <
$(gettext 'Filesystem usage statistics')
-
$(fdisk -l | fgrep Disk)
+
$(disk_info)
EOT @@ -374,7 +381,7 @@ # action action="mount" [ -n "$mp" ] && action="umount" - type=$(blkid $fs | sed '/TYPE=/!d;s/.*TYPE="\([^"]*\).*/\1/') + type=$(blkid $fs | sed '/TYPE=/!d;s/.* TYPE="\([^"]*\).*/\1/') [ "$type" == "swap" ] && action="swapon" if grep -q "^$fs " /proc/swaps; then action="swapoff"