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

15
inxi
View file

@ -1,7 +1,7 @@
#!/bin/bash
########################################################################
#### Script Name: inxi
#### version: 1.8.1
#### version: 1.8.2
#### Date: May 11 2012
#### Patch Number: 01
########################################################################
@ -5479,6 +5479,13 @@ get_raid_data()
mdstat="$( cat $FILE_MDSTAT 2>/dev/null )"
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
# 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.
@ -7859,6 +7866,8 @@ print_raid_data()
fi
if [[ ${a_partition_working[4]} != '' ]];then
device_report="${a_partition_working[4]}"
else
device_report="N/A"
fi
if [[ $B_EXTRA_DATA == 'true' ]];then
if [[ ${a_partition_working[6]} != '' ]];then
@ -7922,7 +7931,9 @@ print_raid_data()
fi
if [[ $device_components != '' ]];then
if [[ $B_EXTRA_DATA != 'true' ]];then
device_components="$device_report - $device_components"
if [[ $device_report != 'N/A' ]];then
device_components="$device_report - $device_components"
fi
fi
device_components=" ${C1}components${SEP3}${C2} $device_components$failed$spare"
fi