fixed weak point on unloading driver logic, it can be several strings to test

This commit is contained in:
inxi-svn 2011-05-30 04:55:38 +00:00
parent eb9db620ba
commit 6eacbd3e13

4
inxi
View file

@ -284,6 +284,7 @@ B_SCSI_FILE='false'
### File's used when present
FILE_ASOUND_DEVICE='/proc/asound/cards'
FILE_ASOUND_MODULES='/proc/asound/modules' # not used but maybe for -A?
FILE_ASOUND_VERSION='/proc/asound/version'
FILE_CPUINFO='/proc/cpuinfo'
FILE_LSB_RELEASE='/etc/lsb-release'
@ -3206,7 +3207,8 @@ get_graphics_driver()
if [[ -n $( grep -s "[[:space:]]Loading.*${driver}_drv.so" <<< "$xorg_log_data" ) ]];then
if [[ -n $( grep -si "Failed.*${driver}_drv.so" <<< "$xorg_log_data" ) ]];then
status='failed'
elif [[ -n $( grep -si "Unloading[[:space:]]${driver}$" <<< "$xorg_log_data" ) ]];then
# can be Unloading driver OR Unloading /usr/lib/xorg/modules/drivers/driver_drv.so
elif [[ -n $( grep -Esi "Unloading[[:space:]](${driver}|.*${driver}_drv.so)$" <<< "$xorg_log_data" ) ]];then
status='unloaded'
else
status='loaded'