more tests, safeguards

This commit is contained in:
inxi-svn 2008-11-14 03:28:27 +00:00
parent 14746d68f1
commit b79da13099

13
inxi
View file

@ -1936,6 +1936,7 @@ print_audio_data()
# if [[ -n ${a_audio_working[2]} ]];then # if [[ -n ${a_audio_working[2]} ]];then
# port_data=" ${C1}at port${C2} ${a_audio_working[2]}" # port_data=" ${C1}at port${C2} ${a_audio_working[2]}"
# fi # fi
# this should only trigger if the /proc/asound/cards data is used, not lspci -nn
if [[ -n ${a_audio_working[1]} && ${a_audio_working[1]} != 'alsa' ]];then if [[ -n ${a_audio_working[1]} && ${a_audio_working[1]} != 'alsa' ]];then
alsa_driver=" ${C1}driver${C2} ${a_audio_working[1]}" alsa_driver=" ${C1}driver${C2} ${a_audio_working[1]}"
fi fi
@ -1953,17 +1954,19 @@ print_audio_data()
# if [[ ${a_audio_working[2]} == 'port' ]];then # if [[ ${a_audio_working[2]} == 'port' ]];then
# port_data=" ${C1}at port${C2} ${a_audio_working[2]}" # port_data=" ${C1}at port${C2} ${a_audio_working[2]}"
# fi # fi
# we're testing for the presence of the 2nd array item here # we're testing for the presence of the 2nd array item here, which is the driver name
if [[ -n ${a_audio_working[1]} && ${a_audio_working[1]} != 'alsa' ]];then if [[ -n ${a_audio_working[1]} && ${a_audio_working[1]} != 'alsa' ]];then
alsa_driver="${C1}driver${C2} ${a_audio_working[1]}" alsa_driver="${C1}driver${C2} ${a_audio_working[1]}"
fi fi
if [[ ${a_audio_working[1]} != 'alsa' ]];then if [[ -n ${a_audio_working[1]} && ${a_audio_working[1]} != 'alsa' ]];then
audio_data="${C1}Card-$(( $i + 1 )) ${C2}${a_audio_working[0]}$alsa_driver$port_data" audio_data="${C1}Card-$(( $i + 1 )) ${C2}${a_audio_working[0]}$alsa_driver$port_data"
else elif [[ -n ${a_audio_working[1]} && ${a_audio_working[1]} == 'alsa' ]];then
audio_data="${C1}Sound: ${C2}${a_audio_working[0]}" audio_data="${C1}Sound: ${C2}${a_audio_working[0]}"
fi fi
audio_data=$( create_print_line " " "$audio_data" ) if [[ -n $audio_data ]];then
print_screen_output "$audio_data" audio_data=$( create_print_line " " "$audio_data" )
print_screen_output "$audio_data"
fi
done done
fi fi
} }