mirror of
https://github.com/smxi/inxi.git
synced 2025-01-19 08:57:57 +00:00
Trying out a usb device fix
This commit is contained in:
parent
ac5337d56f
commit
eeacc5cdf5
18
inxi
18
inxi
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
########################################################################
|
||||
#### Script Name: inxi
|
||||
#### version: 0.4.1
|
||||
#### version: 0.4.2
|
||||
#### Date: November 7 2008
|
||||
########################################################################
|
||||
#### 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
|
||||
IFS=$'\n'
|
||||
## 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' '
|
||||
BEGIN { IGNORECASE=1 }
|
||||
/^ata|scsi/ {
|
||||
gsub(/,/, " ", $2)
|
||||
gsub(/^ +| +$/, "", $2)
|
||||
print $2
|
||||
/^ata|^scsi|pmap$/ {
|
||||
gsub(/,/, " ", $(NF -1) )
|
||||
gsub(/^ +| +$/, "", $(NF -1) )
|
||||
print $(NF -1)
|
||||
}
|
||||
' /proc/scsi/sg/device_strs ) )
|
||||
IFS="$ORIGINAL_IFS"
|
||||
|
@ -1256,7 +1257,12 @@ get_hard_drive_data_advanced()
|
|||
a_temp_working[2]=${a_temp_scsi[$j]}
|
||||
break
|
||||
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
|
||||
done
|
||||
# these loops are to easily extend the cpu array created in the awk script above with more fields per cpu.
|
||||
|
|
Loading…
Reference in a new issue