Trying out a usb device fix

This commit is contained in:
inxi-svn 2008-11-08 05:34:57 +00:00
parent ac5337d56f
commit eeacc5cdf5

18
inxi
View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### version: 0.4.1 #### version: 0.4.2
#### Date: November 7 2008 #### Date: November 7 2008
######################################################################## ########################################################################
#### inxi is a fork of infobash, the original bash sys info script by locsmif #### inxi is a fork of infobash, the original bash sys info script by locsmif
@ -1225,12 +1225,13 @@ get_hard_drive_data_advanced()
if [[ -e /proc/scsi/sg/device_strs ]]; then if [[ -e /proc/scsi/sg/device_strs ]]; then
IFS=$'\n' IFS=$'\n'
## prints out hdd device if field one is ATA type (sata compatibility mode) or prints out scsi device ## prints out hdd device if field one is ATA type (sata compatibility mode) or prints out scsi device
# note: pmap handles usb mounted devices, which have a null first field
a_temp_scsi=( $( gawk -F'\t' ' a_temp_scsi=( $( gawk -F'\t' '
BEGIN { IGNORECASE=1 } BEGIN { IGNORECASE=1 }
/^ata|scsi/ { /^ata|^scsi|pmap$/ {
gsub(/,/, " ", $2) gsub(/,/, " ", $(NF -1) )
gsub(/^ +| +$/, "", $2) gsub(/^ +| +$/, "", $(NF -1) )
print $2 print $(NF -1)
} }
' /proc/scsi/sg/device_strs ) ) ' /proc/scsi/sg/device_strs ) )
IFS="$ORIGINAL_IFS" IFS="$ORIGINAL_IFS"
@ -1256,7 +1257,12 @@ get_hard_drive_data_advanced()
a_temp_working[2]=${a_temp_scsi[$j]} a_temp_working[2]=${a_temp_scsi[$j]}
break break
else else
a_temp_working[2]="Error" # special initial usb handling
# if [[ -n $( ls -l /dev/disk/by-id | egrep -m1 ".*/USB.*${a_temp_working[0]}$" ) ]];then
#
# else
a_temp_working[2]="Error"
# fi
fi fi
done done
# these loops are to easily extend the cpu array created in the awk script above with more fields per cpu. # these loops are to easily extend the cpu array created in the awk script above with more fields per cpu.