fixed small issue, turns out sometimes for raid devices, the [2/2] [UU] type data is simply not present.

That is now handled explicitly, version 1.8.2
This commit is contained in:
inxi-svn 2012-05-11 18:46:54 +00:00
parent 5af065c955
commit 53c1943a82

13
inxi
View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### version: 1.8.1 #### version: 1.8.2
#### Date: May 11 2012 #### Date: May 11 2012
#### Patch Number: 01 #### Patch Number: 01
######################################################################## ########################################################################
@ -5479,6 +5479,13 @@ get_raid_data()
mdstat="$( cat $FILE_MDSTAT 2>/dev/null )" mdstat="$( cat $FILE_MDSTAT 2>/dev/null )"
fi fi
mdstat="Personalities : [raid0] [raid1]
md5 : active raid0 sdc1[0] sdd1[1]
976769024 blocks super 1.2 512k chunks
md4 : active raid1 sde2[0] sdf2[1]
955788224 blocks [2/2] [UU]"
if [[ -n $mdstat ]];then if [[ -n $mdstat ]];then
# need to make sure there's always a newline in front of each record type, and # need to make sure there's always a newline in front of each record type, and
# also correct possible weird formats for the output from older kernels etc. # also correct possible weird formats for the output from older kernels etc.
@ -7859,6 +7866,8 @@ print_raid_data()
fi fi
if [[ ${a_partition_working[4]} != '' ]];then if [[ ${a_partition_working[4]} != '' ]];then
device_report="${a_partition_working[4]}" device_report="${a_partition_working[4]}"
else
device_report="N/A"
fi fi
if [[ $B_EXTRA_DATA == 'true' ]];then if [[ $B_EXTRA_DATA == 'true' ]];then
if [[ ${a_partition_working[6]} != '' ]];then if [[ ${a_partition_working[6]} != '' ]];then
@ -7922,8 +7931,10 @@ print_raid_data()
fi fi
if [[ $device_components != '' ]];then if [[ $device_components != '' ]];then
if [[ $B_EXTRA_DATA != 'true' ]];then if [[ $B_EXTRA_DATA != 'true' ]];then
if [[ $device_report != 'N/A' ]];then
device_components="$device_report - $device_components" device_components="$device_report - $device_components"
fi fi
fi
device_components=" ${C1}components${SEP3}${C2} $device_components$failed$spare" device_components=" ${C1}components${SEP3}${C2} $device_components$failed$spare"
fi fi
fi fi