From 0dd68f45886cfe5414dc99c78a5721e38d0afa9c Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Thu, 27 Mar 2014 20:27:53 +0000 Subject: [PATCH] branch one, try 3 --- inxi | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/inxi b/inxi index c944301..cd1f74d 100755 --- a/inxi +++ b/inxi @@ -3,7 +3,7 @@ #### Script Name: inxi #### Version: 2.1.11 #### Date: 2014-03-26 -#### Patch Number: 02-b1 +#### Patch Number: 03-b1 ######################################################################## #### SPECIAL THANKS ######################################################################## @@ -7719,23 +7719,20 @@ get_raid_component_data_bsd() separator=' ' done else - for device in ${a_raid_data[0]} - do - component_string=$( gawk ' - BEGIN { - IGNORECASE=1 - separator="" - components="" + component_string=$( gawk ' + BEGIN { + IGNORECASE=1 + separator="" + components="" + } + $1 ~ /^'$device'$/ { + while ( getline && !/^$/ ) { + sub( /ONLINE/, "", $2 ) + components=components $1 separator $2 + separator=" " } - $1 ~ /^'$device'$/ { - while ( getline && !/^$/ { - sub( /ONLINE/, "", $2 ) - components=components $1 separator $2 - separator=" " - } - print components - }' <<< "$zpool_status" ) - done + print components + }' <<< "$zpool_status" ) fi array_string="$device,${a_raid_data[1]},${a_raid_data[2]},$component_string,${a_raid_data[4]}" array_string="$array_string,${a_raid_data[5]},${a_raid_data[6]},${a_raid_data[7]},${a_raid_data[8]}"