branch one, try 2

This commit is contained in:
inxi-svn 2014-03-27 20:24:21 +00:00
parent ddcb8b49a3
commit 1654dca7de

52
inxi
View file

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