removed RAID line from -b output if either no /proc/mdstat file or if no raid devices detected. -b should always

be as short and non verbose as possible. Also noted in --help that -b does not show hard drive names, just totals.
This commit is contained in:
inxi-svn 2012-05-11 17:30:17 +00:00
parent 20cd60a6ad
commit 654694cd16

20
inxi
View file

@ -1,8 +1,8 @@
#!/bin/bash
########################################################################
#### Script Name: inxi
#### version: 1.8.0
#### Date: May 10 2012
#### version: 1.8.1
#### Date: May 11 2012
#### Patch Number: 00
########################################################################
#### SPECIAL THANKS
@ -2148,7 +2148,7 @@ show_options()
print_screen_output "- - - - - - - - - - - - - - - - - - - - - - - - - - - - -"
print_screen_output "Output Control Options:"
print_screen_output "-A Show Audio/sound card information."
print_screen_output "-b Shows basic output, short form (previously -d). Same as: $SCRIPT_NAME -v 2"
print_screen_output "-b Shows basic output, short form. Same as: $SCRIPT_NAME -v 2 except only hard disk capacity/used shows."
print_screen_output "-c Available color schemes. Scheme number is required. Color selectors run a color selector option"
print_screen_output " prior to $SCRIPT_NAME starting which lets you set the config file value for the selection."
print_screen_output " Supported color schemes: 0-$color_scheme_count Example: $SCRIPT_NAME -c 11"
@ -7793,7 +7793,7 @@ print_raid_data()
local a_partition_working='' raid_data='' kernel_support='' read_ahead='' unused_devices=''
local basic_raid='' basic_raid_separator='' basic_raid_plural='' inactive=''
local component_separator='' device_id='' print_string='' loop_limit=0 array_count_unused=''
local array_count='' raid_event=''
local array_count='' raid_event='' b_print_lines='true'
get_raid_data
@ -8000,10 +8000,18 @@ print_raid_data()
fi
if [[ $B_MDSTAT_FILE != 'true' ]];then
if [[ $B_SHOW_BASIC_RAID != 'true' ]];then
a_raid_data[0]="${C1}Error${SEP3}${C2} No /proc/mdstat file detected!"
else
b_print_lines='false'
fi
else
if [[ ${a_raid_data[0]} == '' ]];then
if [[ $B_SHOW_BASIC_RAID != 'true' ]];then
a_raid_data[0]="${C1}Device${SEP3}${C2} No RAID devices detected!"
else
b_print_lines='false'
fi
fi
# now let's add on the system line and the unused device line. Only print on -xx
if [[ $kernel_support$read_ahead$raid_event != '' ]];then
@ -8017,7 +8025,8 @@ print_raid_data()
loop_limit=2
fi
fi
# we don't want to print anything if it's -b and no data is present, just a waste of a line
if [[ $b_print_lines == 'true' ]];then
# print out all lines, line starter on first line
for (( i=0; i < ${#a_raid_data[@]} - $loop_limit;i++ ))
do
@ -8042,6 +8051,7 @@ print_raid_data()
fi
fi
done
fi
eval $LOGFE
}