From eeacc5cdf506d5b8226fe877c60d1fe13b690f35 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Sat, 8 Nov 2008 05:34:57 +0000 Subject: [PATCH] Trying out a usb device fix --- inxi | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/inxi b/inxi index efa2027..233100b 100755 --- a/inxi +++ b/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.