From 4249f6980c164b2b96cd8946744506361ee18423 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Fri, 14 Nov 2008 09:22:25 +0000 Subject: [PATCH] (Change Version) Found bug with audio, /proc/asound/cards can have modem which creates via space a new array item. Added filters for /modem/ in those spots. --- inxi | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/inxi b/inxi index 0700169..135e12d 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 0.5.30 +#### version: 0.5.31 #### Date: November 13 2008 ######################################################################## #### inxi is a fork of infobash 3.02, the original bash sys info script by locsmif @@ -990,9 +990,12 @@ get_audio_data() IFS=$'\n' # this is awkward, but it should work, ie, if there's only one sound card found + # have to filter out modems because they also appear on asound/cards device_count=$( egrep -ic '(multimedia audio controller|audio device)' <<< "$lspci_data" ) if [[ $device_count -eq 1 && -f /proc/asound/cards ]];then - alsa_driver=$( gawk -F ']: ' '{ + alsa_driver=$( gawk -F ']: ' ' + { IGNORECASE=1 } + $1 !~ /modem/ && $2 !~ /modem/ { driver=gensub( /^(.+)( - )(.+)$/, "\\1", 1, $2 ) gsub(/^ +| +$/,"",driver) if ( driver != "" ){ @@ -1019,7 +1022,9 @@ get_audio_data() # c=gensub( /^ *vendor: (.+) +model: (.+) +rev:.*$/, "\\2", "g", a[i] ) # in case of failure of first check do this instead if [[ ${#A_AUDIO_DATA[@]} -eq 0 && -f /proc/asound/cards ]];then - A_AUDIO_DATA=( $( gawk -F ']: ' '{ + A_AUDIO_DATA=( $( gawk -F ']: ' ' + { IGNORECASE=1 } + $1 !~ /modem/ && $2 !~ /modem/ { card=gensub( /^(.+)( - )(.+)$/, "\\3", 1, $2 ) driver=gensub( /^(.+)( - )(.+)$/, "\\1", 1, $2 ) if ( card != "" ){