mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
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:
parent
20cd60a6ad
commit
654694cd16
66
inxi
66
inxi
|
@ -1,8 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
########################################################################
|
########################################################################
|
||||||
#### Script Name: inxi
|
#### Script Name: inxi
|
||||||
#### version: 1.8.0
|
#### version: 1.8.1
|
||||||
#### Date: May 10 2012
|
#### Date: May 11 2012
|
||||||
#### Patch Number: 00
|
#### Patch Number: 00
|
||||||
########################################################################
|
########################################################################
|
||||||
#### SPECIAL THANKS
|
#### SPECIAL THANKS
|
||||||
|
@ -2148,7 +2148,7 @@ show_options()
|
||||||
print_screen_output "- - - - - - - - - - - - - - - - - - - - - - - - - - - - -"
|
print_screen_output "- - - - - - - - - - - - - - - - - - - - - - - - - - - - -"
|
||||||
print_screen_output "Output Control Options:"
|
print_screen_output "Output Control Options:"
|
||||||
print_screen_output "-A Show Audio/sound card information."
|
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 "-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 " 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"
|
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 a_partition_working='' raid_data='' kernel_support='' read_ahead='' unused_devices=''
|
||||||
local basic_raid='' basic_raid_separator='' basic_raid_plural='' inactive=''
|
local basic_raid='' basic_raid_separator='' basic_raid_plural='' inactive=''
|
||||||
local component_separator='' device_id='' print_string='' loop_limit=0 array_count_unused=''
|
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
|
get_raid_data
|
||||||
|
|
||||||
|
@ -8000,10 +8000,18 @@ print_raid_data()
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $B_MDSTAT_FILE != 'true' ]];then
|
if [[ $B_MDSTAT_FILE != 'true' ]];then
|
||||||
a_raid_data[0]="${C1}Error${SEP3}${C2} No /proc/mdstat file detected!"
|
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
|
else
|
||||||
if [[ ${a_raid_data[0]} == '' ]];then
|
if [[ ${a_raid_data[0]} == '' ]];then
|
||||||
a_raid_data[0]="${C1}Device${SEP3}${C2} No RAID devices detected!"
|
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
|
fi
|
||||||
# now let's add on the system line and the unused device line. Only print on -xx
|
# 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
|
if [[ $kernel_support$read_ahead$raid_event != '' ]];then
|
||||||
|
@ -8017,31 +8025,33 @@ print_raid_data()
|
||||||
loop_limit=2
|
loop_limit=2
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
# we don't want to print anything if it's -b and no data is present, just a waste of a line
|
||||||
# print out all lines, line starter on first line
|
if [[ $b_print_lines == 'true' ]];then
|
||||||
for (( i=0; i < ${#a_raid_data[@]} - $loop_limit;i++ ))
|
# print out all lines, line starter on first line
|
||||||
do
|
for (( i=0; i < ${#a_raid_data[@]} - $loop_limit;i++ ))
|
||||||
if [[ $i -eq 0 ]];then
|
do
|
||||||
line_starter='RAID:'
|
if [[ $i -eq 0 ]];then
|
||||||
else
|
line_starter='RAID:'
|
||||||
line_starter=' '
|
else
|
||||||
fi
|
|
||||||
if [[ $B_EXTRA_EXTRA_DATA == 'true' && $array_count != '' ]];then
|
|
||||||
if [[ $i == 0 ]];then
|
|
||||||
raid_data=$( create_print_line "$line_starter" "${a_raid_data[array_count]}" )
|
|
||||||
print_screen_output "$raid_data"
|
|
||||||
line_starter=' '
|
line_starter=' '
|
||||||
fi
|
fi
|
||||||
fi
|
if [[ $B_EXTRA_EXTRA_DATA == 'true' && $array_count != '' ]];then
|
||||||
raid_data=$( create_print_line "$line_starter" "${a_raid_data[i]}" )
|
if [[ $i == 0 ]];then
|
||||||
print_screen_output "$raid_data"
|
raid_data=$( create_print_line "$line_starter" "${a_raid_data[array_count]}" )
|
||||||
if [[ $B_EXTRA_EXTRA_DATA == 'true' && $array_count_unused != '' ]];then
|
print_screen_output "$raid_data"
|
||||||
if [[ $i == $(( array_count_unused - 2 )) ]];then
|
line_starter=' '
|
||||||
raid_data=$( create_print_line "$line_starter" "${a_raid_data[array_count_unused]}" )
|
fi
|
||||||
print_screen_output "$raid_data"
|
|
||||||
fi
|
fi
|
||||||
fi
|
raid_data=$( create_print_line "$line_starter" "${a_raid_data[i]}" )
|
||||||
done
|
print_screen_output "$raid_data"
|
||||||
|
if [[ $B_EXTRA_EXTRA_DATA == 'true' && $array_count_unused != '' ]];then
|
||||||
|
if [[ $i == $(( array_count_unused - 2 )) ]];then
|
||||||
|
raid_data=$( create_print_line "$line_starter" "${a_raid_data[array_count_unused]}" )
|
||||||
|
print_screen_output "$raid_data"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
eval $LOGFE
|
eval $LOGFE
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue