From 53c1943a824a6cd1122fe28f81b65ee90b5ec12a Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Fri, 11 May 2012 18:46:54 +0000 Subject: [PATCH] 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 --- inxi | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/inxi b/inxi index 43c38fb..3fd85e6 100755 --- a/inxi +++ b/inxi @@ -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