From 27a128f93cc0bacf124714cf3eccd7a955e63954 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Fri, 31 Oct 2008 02:00:02 +0000 Subject: [PATCH] For video, added null case in video card detection --- inxi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/inxi b/inxi index 3019b72..56de977 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 0.2.7 +#### version: 0.2.8 #### Date: October 30 2008 ######################################################################## #### inxi is a fork of infobash, the original bash sys info script by locsmif @@ -915,6 +915,10 @@ get_graphics_card_data() do A_GFX_CARD_DATA[i]=$( sanitize_characters A_NORMAL_BANS "${A_GFX_CARD_DATA[i]}" ) done + # handle cases where card detection fails, like in PS3, where lspci gives no output, or headless boxes.. + if [[ ${#A_GFX_CARD_DATA[@]} -eq 0 ]];then + A_GFX_CARD_DATA[0]='Failed to Detect Video Card!' + fi # GFXMEM is UNUSED at the moment, because it shows AGP aperture size, which is not necessarily equal to GFX memory.. # GFXMEM="size=[$(echo "$LSPCI" | gawk '/VGA/{while (!/^$/) {getline;if (/size=[0-9][0-9]*M/) {size2=gensub(/.*\[size=([0-9]+)M\].*/,"\\1","g",$0);if (size