From ac5337d56fd9afea15dafebcf3a9b873fdf46e0b Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Sat, 8 Nov 2008 05:18:01 +0000 Subject: [PATCH] Fixed a bug with WDC, requires for the ls -l /dev/disk/by-id test replacing whitespace with _, and trimming off the last part of the string --- inxi | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/inxi b/inxi index 29d9af9..efa2027 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 0.4.0 +#### version: 0.4.1 #### Date: November 7 2008 ######################################################################## #### inxi is a fork of infobash, the original bash sys info script by locsmif @@ -1191,10 +1191,7 @@ get_hdd_data_basic() ## fills out the A_HDD_DATA array with disk names get_hard_drive_data_advanced() { - local disk='' i='' j='' hdd_cap2='' hdd_cap1='' disk_capacity='' a_total_hdd='' - local hdd_model='' hdd_capacity='' hdd_used='' - - local a_temp_working='' a_temp_scsi='' temp_holder='' + local a_temp_working='' a_temp_scsi='' temp_holder='' temp_name='' i='' j='' ## next check for all ide type drives, non libata, only do it if hdx is in array if [[ -n $( egrep 'hd[a-z]' <<< ${A_HDD_DATA[@]} ) ]];then @@ -1253,7 +1250,9 @@ get_hard_drive_data_advanced() do ## ok, ok, it's incomprehensible, search /dev/disk/by-id for a line that contains the # discovered disk name AND ends with the correct identifier, sdx - if [[ -n $( ls -l /dev/disk/by-id | egrep -m1 ".*${a_temp_scsi[$j]}.*${a_temp_working[0]}$" ) ]];then + temp_name=$( tr ' ' '_' <<< ${a_temp_scsi[$j]} | cut -d '-' -f 1 ) # get rid of whitespace for WDC +# echo temp_name:$temp_name + if [[ -n $( ls -l /dev/disk/by-id | egrep -m1 ".*$temp_name.*${a_temp_working[0]}$" ) ]];then a_temp_working[2]=${a_temp_scsi[$j]} break else