cleaned up, only check file once

This commit is contained in:
inxi-svn 2011-05-23 22:36:25 +00:00
parent bb8f7e279c
commit 1fc7e1ad46

6
inxi
View file

@ -3196,16 +3196,18 @@ get_graphics_driver()
eval $LOGFS
local driver_list='apm ark ati chips cirrus cyrix fbdev fglrx glint i128 i740 intel i810 imstt mach64 mga neomagic nsc nv nvidia openchrome nouveau radeon radeonhd rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng unichrome vesa vga via voodoo vmware v4l'
local driver='' driver_string='' spacer=''
local driver='' driver_string='' spacer='' xorg_log_data=''
if [[ $B_XORG_LOG == 'true' ]];then
xorg_log_data="$( cat $FILE_XORG_LOG )"
for driver in $driver_list
do
if [[ -n $( grep -s "[[:space:]]Loading.*${driver}_drv.so" $FILE_XORG_LOG ) && -z $( grep -s "[[:space:]]Unloading.*${driver}_drv.so" $FILE_XORG_LOG ) ]];then
if [[ -n $( grep -s "[[:space:]]Loading.*${driver}_drv.so" <<< "$xorg_log_data" ) && -z $( grep -s "[[:space:]]Unloading.*${driver}_drv.so" <<< "$xorg_log_data" ) ]];then
driver_string="$driver_string$driver$spacer"
spacer=' '
fi
done
xorg_log_data='' # dump from ram, does it matter?
fi
echo $driver_string