fixed up, made consistent and maybe more reliable

This commit is contained in:
inxi-svn 2011-05-25 01:03:29 +00:00
parent 5e093d108c
commit a3494fb58a

8
inxi
View file

@ -3224,15 +3224,13 @@ get_graphics_driver()
xorg_log_data="$( cat $FILE_XORG_LOG )"
for driver in $driver_list
do
# note there appears to be different unload/failed syntax, so using simple conservative one
# I was not able to find a case where xorg.log shows unload and not fail
if [[ -n $( grep -s "[[:space:]]Loading.*${driver}_drv.so" <<< "$xorg_log_data" ) ]];then
if [[ -z $( grep -si "[[:space:]]Unload.*${driver}" <<< "$xorg_log_data" ) ]];then
if [[ -z $( grep -si "Failed.*${driver}_drv.so" <<< "$xorg_log_data" ) ]];then
status='loaded'
else
if [[ -n $( grep -si "Failed[[:space:]]to[[:space:]]load[[:space:]].*${driver}_drv.so" <<< "$xorg_log_data" ) ]];then
status='failed'
else
status='unloaded'
fi
fi
driver_string="$driver_string$driver->$status$spacer"
spacer=' '