diff --git a/inxi b/inxi index 0368dc3..c944301 100755 --- a/inxi +++ b/inxi @@ -3,7 +3,7 @@ #### Script Name: inxi #### Version: 2.1.11 #### Date: 2014-03-26 -#### Patch Number: 01-b1 +#### Patch Number: 02-b1 ######################################################################## #### SPECIAL THANKS ######################################################################## @@ -7702,29 +7702,41 @@ get_raid_component_data_bsd() # we will remove ONLINE for status and only use OFFLINE/DEGRADED as tests # for print output display of issues with components # note: different zfs outputs vary, some have the components listed by line - for component in ${a_raid_data[3]} - do - component_status=$( gawk -v zpoolType=$1 ' - BEGIN { - IGNORECASE=1 - separator="" - } - $1 ~ /^'$component'$/ { - if ( zpoolType == "v" ) { + if [[ $1 == 'v' ]];then + for component in ${a_raid_data[3]} + do + component_status=$( gawk ' + BEGIN { + IGNORECASE=1 + separator="" + } + $1 ~ /^'$component'$/ { sub( /ONLINE/, "", $2 ) print "'$component'" $2 exit - elseif (zpoolType == "no-v" ) { - while (getline && !/^$/) { - component=component separator $1 - separator="," - } - print "'$component'" component + }' <<< "$zpool_status" ) + component_string="$component_string$separator$component_status" + separator=' ' + done + else + for device in ${a_raid_data[0]} + do + component_string=$( gawk ' + BEGIN { + IGNORECASE=1 + separator="" + components="" } - }' <<< "$zpool_status" ) - component_string="$component_string$separator$component_status" - separator=' ' - done + $1 ~ /^'$device'$/ { + while ( getline && !/^$/ { + sub( /ONLINE/, "", $2 ) + components=components $1 separator $2 + separator=" " + } + print components + }' <<< "$zpool_status" ) + done + 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]}" array_string="$array_string,${a_raid_data[9]},${a_raid_data[10]},${a_raid_data[11]},${a_raid_data[12]},"