handling of tsst corp string

This commit is contained in:
inxi-svn 2011-06-18 02:59:58 +00:00
parent ecb4e51a59
commit bff32dc844

16
inxi
View file

@ -4548,8 +4548,7 @@ get_optical_drive_data()
sys_path=$( ls /sys/devices/pci*/*/host*/target*/*/block/$disk/uevent 2>/dev/null | sed "s|/block/$disk/uevent||" )
# no need to test for errors yet, probably other user systems will require some alternate paths though
if [[ -n $sys_path ]];then
vendor=$( cat $sys_path/vendor 2>/dev/null | \
sed -E -e 's/^[[:space:]]*//;s/[[:space:]]*$//;s/,//g' -e 's/TSSTcorp/TSST /' -e 's/('"$BAN_LIST_NORMAL"')//g' )
vendor=$( cat $sys_path/vendor 2>/dev/null | sed -e 's/^[[:space:]]*//;s/[[:space:]]*$//;s/,//g' )
model=$( cat $sys_path/model 2>/dev/null | sed 's/^[[:space:]]*//;s/[[:space:]]*$//;s/,//g' )
state=$( cat $sys_path/state 2>/dev/null | sed 's/^[[:space:]]*//;s/[[:space:]]*$//;s/,//g' )
rev_number=$( cat $sys_path/rev 2>/dev/null | sed 's/^[[:space:]]*//;s/[[:space:]]*$//;s/,//g' )
@ -4557,6 +4556,19 @@ get_optical_drive_data()
elif [[ -e /proc/ide/$disk/model ]];then
vendor=$( cat /proc/ide/$disk/model 2>/dev/null | sed 's/^[[:space:]]*//;s/[[:space:]]*$//;s/,//g' )
fi
if [[ -n $vendor ]];then
vendor=$( gawk '
BEGIN {
IGNORECASE=1
}
{
gsub(/'"$BAN_LIST_NORMAL"'/, "", $0)
sub(/TSSTcorp/, "TSST ", $0) # seen more than one of these weird ones
print $0
}
' <<< $vendor
)
fi
if [[ $B_EXTRA_DATA == 'true' && -n $proc_cdrom ]];then
cpuinfo_string=$( gawk -v diskId=$disk '