mirror of
https://github.com/smxi/inxi.git
synced 2024-11-16 16:21:39 +00:00
Added towol fix for removing second line in alsa version output if compiled by second user
This commit is contained in:
parent
4249f6980c
commit
3c6c270e68
28
inxi
28
inxi
|
@ -1,8 +1,8 @@
|
|||
#!/bin/bash
|
||||
########################################################################
|
||||
#### Script Name: inxi
|
||||
#### version: 0.5.31
|
||||
#### Date: November 13 2008
|
||||
#### version: 0.5.32
|
||||
#### Date: November 14 2008
|
||||
########################################################################
|
||||
#### inxi is a fork of infobash 3.02, the original bash sys info script by locsmif
|
||||
#### As time permits functionality improvements and recoding will occur.
|
||||
|
@ -1002,7 +1002,10 @@ get_audio_data()
|
|||
print driver
|
||||
}
|
||||
}' /proc/asound/cards )
|
||||
fi
|
||||
fi\
|
||||
# this is to safeguard against line breaks from results > 1, which if inserted into following
|
||||
# array will create a false array entry. This is a hack, not a permanent solution.
|
||||
alsa_driver=$( echo $alsa_driver )
|
||||
# this isn't perfect, but if one card was found in lscpci, we're passing
|
||||
# this array constructor that card driver name. This should work for most people
|
||||
# but if you can think of anything better, please post the code patch
|
||||
|
@ -1046,17 +1049,18 @@ get_audio_alsa_data()
|
|||
|
||||
# now we'll get the alsa data if the file exists
|
||||
if [[ -e /proc/asound/version ]];then
|
||||
alsa_data=$( gawk '{
|
||||
alsa_data=$( gawk '
|
||||
{ IGNORECASE=1 }
|
||||
# some alsa strings have the build date in (...)
|
||||
# also remove trailing .
|
||||
gsub( "Driver | [(].*[)]|\.$","",$0 )
|
||||
gsub(/,/, " ", $0)
|
||||
gsub(/^ +| +$/, "", $0)
|
||||
gsub(/ [ \t]+/, " ", $0)
|
||||
if ( $0 != "" ){
|
||||
print $0
|
||||
}
|
||||
# remove trailing . and remove possible second line if compiled by user
|
||||
$0 !~ /compile/ {
|
||||
gsub( "Driver | [(].*[)]|\.$","",$0 )
|
||||
gsub(/,/, " ", $0)
|
||||
gsub(/^ +| +$/, "", $0)
|
||||
gsub(/ [ \t]+/, " ", $0)
|
||||
if ( $0 != "" ){
|
||||
print $0
|
||||
}
|
||||
}' /proc/asound/version )
|
||||
fi
|
||||
echo "$alsa_data"
|
||||
|
|
Loading…
Reference in a new issue