fine tuning, get rid of extra grep in loop

This commit is contained in:
inxi-svn 2011-05-01 16:42:33 +00:00
parent dd5a96c38b
commit 7c5fedd3aa

7
inxi
View file

@ -3264,7 +3264,7 @@ get_networking_data()
{ {
eval $LOGFS eval $LOGFS
local b_usb_networking='false' local b_usb_networking='false' id_string=''
IFS=$'\n' IFS=$'\n'
A_NETWORK_DATA=( $( echo "$Lspci_Data" | gawk ' A_NETWORK_DATA=( $( echo "$Lspci_Data" | gawk '
@ -3349,8 +3349,9 @@ get_networking_data()
lsusb_data="$( $lsusb_path 2>/dev/null )" lsusb_data="$( $lsusb_path 2>/dev/null )"
for needle in $USB_NETWORK_SEARCH for needle in $USB_NETWORK_SEARCH
do do
if [[ -n $( grep -isE "$needle" <<< "$lsusb_data" | grep -Eisv '(bluetooth| hub|keyboard|mouse|printer| ps2|reader|scan|storage)' ) ]];then id_string=$( grep -isE "$needle" <<< "$lsusb_data" | grep -Eisv '(bluetooth| hub|keyboard|mouse|printer| ps2|reader|scan|storage)' )
card_data=$( grep -isE "$needle" <<< "$lsusb_data" ) if [[ -n $id_string ]];then
card_data=$id_string
break break
fi fi
done done