diff --git a/inxi b/inxi index 8314c51..e6d6ed4 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 1.3.13 +#### version: 1.3.14 #### Date: February 6 2010 ######################################################################## #### SPECIAL THANKS @@ -2576,7 +2576,7 @@ get_hard_drive_data_advanced() { eval $LOGFS local a_temp_working='' a_temp_scsi='' temp_holder='' temp_name='' i='' j='' - local sd_ls_by_id='' ls_disk_by_id='' + local sd_ls_by_id='' ls_disk_by_id='' usb_exists='' ## 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 @@ -2654,7 +2654,8 @@ get_hard_drive_data_advanced() # /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 )" + temp_name="$( remove_erroneous_chars /sys/block/${a_temp_working[0]}/device/model )" + temp_name=$( tr ' ' '_' <<< $temp_name | cut -d '-' -f 1 ) elif [[ ${#a_temp_scsi[@]} -gt 0 ]];then for (( j=0; j < ${#a_temp_scsi[@]}; j++ )) do @@ -2665,24 +2666,26 @@ get_hard_drive_data_advanced() sd_ls_by_id=$( egrep -m1 ".*$temp_name.*${a_temp_working[0]}$" <<< "$ls_disk_by_id" ) if [[ -n $sd_ls_by_id ]];then - a_temp_working[2]=${a_temp_scsi[$j]} - if [[ -n $( grep 'usb-' <<< $sd_ls_by_id ) ]];then - a_temp_working[3]='USB' - fi + temp_name=${a_temp_scsi[$j]} break else # test to see if we can get a better name output when null if [[ -n $temp_name ]];then - a_temp_working[2]=$temp_name - else - a_temp_working[2]="Name n/a" + temp_name=$temp_name fi fi done - else - a_temp_working[2]="Name n/a" fi - + + if [[ -z $temp_name ]];then + temp_name="Name n/a" + else + usb_exists=$( egrep -m1 "usb-.*$temp_name.*${a_temp_working[0]}$" <<< "$ls_disk_by_id" ) + if [[ -n $usb_exists ]];then + a_temp_working[3]='USB' + fi + fi + a_temp_working[2]=$temp_name # these loops are to easily extend the cpu array created in the gawk script above with more fields per cpu. for (( j=0; j < ${#a_temp_working[@]}; j++ )) do