From 881628d7f0d8b6a253b2bfe418cd77d2d4274775 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Tue, 11 Nov 2008 05:58:15 +0000 Subject: [PATCH] (Change Version) Added fail option for sound card test, also check /proc/asound/cards for something too --- inxi | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/inxi b/inxi index 0236e52..14a9cf7 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 0.5.7 +#### version: 0.5.8 #### Date: November 10 2008 ######################################################################## #### inxi is a fork of infobash, the original bash sys info script by locsmif @@ -886,6 +886,15 @@ get_audio_data() gsub(/ [ \t]+/," ",$NF) print $NF }' ) ) + + # 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 ']: ' '{ + card=gensub( /^(.+)( - )(.+)$/, "\\3", 1, $2 ) + print card + }' /proc/asound/cards ) ) + fi IFS="$ORIGINAL_IFS" # handle cases where card detection fails, like in PS3, where lspci gives no output, or headless boxes..