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