From 7f3c89b63cd415de581608410108ac529249d68d Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Sun, 7 Feb 2010 07:47:07 +0000 Subject: [PATCH] (change version) updated to handle new /sys/block syntax to get device name for disks. This will require further work to actually make solid, but this fix makes it work for now. --- inxi | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/inxi b/inxi index 95d8dcc..8314c51 100755 --- a/inxi +++ b/inxi @@ -1,8 +1,8 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 1.3.12 -#### Date: February 5 2010 +#### version: 1.3.13 +#### Date: February 6 2010 ######################################################################## #### SPECIAL THANKS ######################################################################## @@ -2579,6 +2579,7 @@ get_hard_drive_data_advanced() local sd_ls_by_id='' ls_disk_by_id='' ## check for all ide type drives, non libata, only do it if hdx is in array + ## this is now being updated for new /sys type paths, this may handle that ok too if [[ -n $( egrep 'hd[a-z]' <<< ${A_HDD_DATA[@]} ) ]];then # remember, we're using the last array item to store the total size of disks for (( i=0; i < ${#A_HDD_DATA[@]} - 1; i++ )) @@ -2650,7 +2651,11 @@ get_hard_drive_data_advanced() IFS="," a_temp_working=( ${A_HDD_DATA[$i]} ) IFS="$ORIGINAL_IFS" - if [[ ${#a_temp_scsi[@]} -gt 0 ]];then + # /sys/block/[sda,hda]/device/model + # this is handles the new /sys data types first + if [[ -e /sys/block/${a_temp_working[0]}/device/model ]];then + a_temp_working[2]="$( remove_erroneous_chars /sys/block/${a_temp_working[0]}/device/model )" + elif [[ ${#a_temp_scsi[@]} -gt 0 ]];then for (( j=0; j < ${#a_temp_scsi[@]}; j++ )) do ## ok, ok, it's incomprehensible, search /dev/disk/by-id for a line that contains the