mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
branch one, try 2
This commit is contained in:
parent
ddcb8b49a3
commit
1654dca7de
32
inxi
32
inxi
|
@ -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
|
||||||
|
if [[ $1 == 'v' ]];then
|
||||||
for component in ${a_raid_data[3]}
|
for component in ${a_raid_data[3]}
|
||||||
do
|
do
|
||||||
component_status=$( gawk -v zpoolType=$1 '
|
component_status=$( gawk '
|
||||||
BEGIN {
|
BEGIN {
|
||||||
IGNORECASE=1
|
IGNORECASE=1
|
||||||
separator=""
|
separator=""
|
||||||
}
|
}
|
||||||
$1 ~ /^'$component'$/ {
|
$1 ~ /^'$component'$/ {
|
||||||
if ( zpoolType == "v" ) {
|
|
||||||
sub( /ONLINE/, "", $2 )
|
sub( /ONLINE/, "", $2 )
|
||||||
print "'$component'" $2
|
print "'$component'" $2
|
||||||
exit
|
exit
|
||||||
elseif (zpoolType == "no-v" ) {
|
|
||||||
while (getline && !/^$/) {
|
|
||||||
component=component separator $1
|
|
||||||
separator=","
|
|
||||||
}
|
|
||||||
print "'$component'" component
|
|
||||||
}
|
|
||||||
}' <<< "$zpool_status" )
|
}' <<< "$zpool_status" )
|
||||||
component_string="$component_string$separator$component_status"
|
component_string="$component_string$separator$component_status"
|
||||||
separator=' '
|
separator=' '
|
||||||
done
|
done
|
||||||
|
else
|
||||||
|
for device in ${a_raid_data[0]}
|
||||||
|
do
|
||||||
|
component_string=$( gawk '
|
||||||
|
BEGIN {
|
||||||
|
IGNORECASE=1
|
||||||
|
separator=""
|
||||||
|
components=""
|
||||||
|
}
|
||||||
|
$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="$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]},"
|
||||||
|
|
Loading…
Reference in a new issue