mirror of
https://github.com/smxi/inxi.git
synced 2024-11-16 16:21:39 +00:00
branch one, this might get the raid type too
This commit is contained in:
parent
f856bbcabe
commit
af71683176
17
inxi
17
inxi
|
@ -3,7 +3,7 @@
|
|||
#### Script Name: inxi
|
||||
#### Version: 2.1.11
|
||||
#### Date: 2014-03-26
|
||||
#### Patch Number: 04-b1
|
||||
#### Patch Number: 06-b1
|
||||
########################################################################
|
||||
#### SPECIAL THANKS
|
||||
########################################################################
|
||||
|
@ -7718,23 +7718,34 @@ get_raid_component_data_bsd()
|
|||
component_string="$component_string$separator$component_status"
|
||||
separator=' '
|
||||
done
|
||||
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]},"
|
||||
array_string="$array_string${a_raid_data[13]},${a_raid_data[14]},${a_raid_data[15]}"
|
||||
else
|
||||
component_string=$( gawk '
|
||||
BEGIN {
|
||||
IGNORECASE=1
|
||||
separator=""
|
||||
components=""
|
||||
raidLevel=""
|
||||
}
|
||||
$1 ~ /^'$device'$/ {
|
||||
while ( getline && !/^$/ ) {
|
||||
sub( /ONLINE/, "", $2 )
|
||||
# raid level is the second item in the output
|
||||
if ( $1 != "" ) {
|
||||
raidLevel="zfs " $1
|
||||
getline
|
||||
}
|
||||
components=components separator $1 separator $2
|
||||
separator=" "
|
||||
}
|
||||
print components
|
||||
print raidLevel "," components
|
||||
}' <<< "$zpool_status" )
|
||||
fi
|
||||
array_string="$device,${a_raid_data[1]},${a_raid_data[2]},$component_string,${a_raid_data[4]}"
|
||||
# note: component_string is raid type AND components
|
||||
array_string="$device,${a_raid_data[1]},$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]},"
|
||||
array_string="$array_string${a_raid_data[13]},${a_raid_data[14]},${a_raid_data[15]}"
|
||||
|
|
Loading…
Reference in a new issue