(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.
This commit is contained in:
inxi-svn 2008-11-14 09:22:25 +00:00
parent 88452ba0c9
commit 4249f6980c

11
inxi
View file

@ -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 != "" ){