fixed oversight, forgot to put no cd drive detected if all cd / optical drive data is n ull

This commit is contained in:
inxi-svn 2011-07-22 07:03:26 +00:00
parent 93a7e248d9
commit 982f9a3e57

14
inxi
View file

@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### version: 1.7.18 #### version: 1.7.19
#### Date: July 20 2011 #### Date: July 22 2011
#### Patch Number: 00 #### Patch Number: 00
######################################################################## ########################################################################
#### SPECIAL THANKS #### SPECIAL THANKS
@ -7097,7 +7097,7 @@ print_optical_drive_data()
eval $LOGFS eval $LOGFS
local a_drives='' drive_data='' counter='' local a_drives='' drive_data='' counter=''
local drive_id='' drive_links='' vendor='' speed='' multisession='' mcn='' audio='' local drive_id='' drive_links='' vendor='' speed='' multisession='' mcn='' audio=''
local dvd='' state='' rw_support='' rev='' separator='' local dvd='' state='' rw_support='' rev='' separator='' drive_string=''
get_optical_drive_data get_optical_drive_data
# 0 - true dev path, ie, sr0, hdc # 0 - true dev path, ie, sr0, hdc
# 1 - dev links to true path # 1 - dev links to true path
@ -7123,7 +7123,9 @@ print_optical_drive_data()
speed='' speed=''
state='' state=''
vendor='' vendor=''
if [[ ${#A_OPTICAL_DRIVE_DATA[@]} -eq 1 && -z ${a_drives[0]} && -z ${a_drives[1]} ]];then
drive_string="No optical drive detected."
else
if [[ ${#A_OPTICAL_DRIVE_DATA[@]} -gt 1 ]];then if [[ ${#A_OPTICAL_DRIVE_DATA[@]} -gt 1 ]];then
counter="-$(( i + 1 ))" counter="-$(( i + 1 ))"
fi fi
@ -7157,7 +7159,9 @@ print_optical_drive_data()
fi fi
rev=" ${C1}rev$SEP3${C2} $rev" rev=" ${C1}rev$SEP3${C2} $rev"
fi fi
drive_data="${C1}Optical${counter}:${C2} $drive_id ${C1}model$SEP3${C2} $vendor$rev ${C1}dev-links$SEP3${C2} $drive_links" drive_string="$drive_id ${C1}model$SEP3${C2} $vendor$rev ${C1}dev-links$SEP3${C2} $drive_links"
fi
drive_data="${C1}Optical${counter}:${C2} $drive_string"
drive_data=$( create_print_line "$Line_Starter" "$drive_data" ) drive_data=$( create_print_line "$Line_Starter" "$drive_data" )
print_screen_output "$drive_data" print_screen_output "$drive_data"
Line_Starter=' ' Line_Starter=' '