mirror of
https://github.com/smxi/inxi.git
synced 2025-01-19 08:57:57 +00:00
New version, bug fix for mdraid, and cleaned up some errors and weak spots in component
output for mdraid. Certain conditions would trigger a false return for raid components, now it shows more explicitly the online/spare/failed data so it's clear. Also shows 'none' for online if none are detected.
This commit is contained in:
parent
c4be977f5c
commit
2a93e5e522
21
inxi
21
inxi
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
########################################################################
|
########################################################################
|
||||||
#### Script Name: inxi
|
#### Script Name: inxi
|
||||||
#### Version: 1.8.39
|
#### Version: 1.8.40
|
||||||
#### Date: February 27 2013
|
#### Date: February 27 2013
|
||||||
#### Patch Number: 00
|
#### Patch Number: 00
|
||||||
########################################################################
|
########################################################################
|
||||||
|
@ -6699,7 +6699,7 @@ get_raid_data()
|
||||||
if ( $0 ~ /^md/ ) {
|
if ( $0 ~ /^md/ ) {
|
||||||
device = gensub(/(md.*)[[:space:]]?:/, "\\1", "1", $1 )
|
device = gensub(/(md.*)[[:space:]]?:/, "\\1", "1", $1 )
|
||||||
}
|
}
|
||||||
if ( $0 ~ /raid[0-9]+/ ) {
|
if ( $0 ~ /mirror|raid[0-9]+/ ) {
|
||||||
raidLevel = gensub(/(.*)raid([0-9]+)(.*)/, "\\2", "g", $0 )
|
raidLevel = gensub(/(.*)raid([0-9]+)(.*)/, "\\2", "g", $0 )
|
||||||
}
|
}
|
||||||
if ( $0 ~ /(active \(auto-read-only\)|active|inactive)/ ) {
|
if ( $0 ~ /(active \(auto-read-only\)|active|inactive)/ ) {
|
||||||
|
@ -6772,7 +6772,7 @@ get_raid_data()
|
||||||
|
|
||||||
temp_array=${A_RAID_DATA[@]}
|
temp_array=${A_RAID_DATA[@]}
|
||||||
log_function_data "A_RAID_DATA: $temp_array"
|
log_function_data "A_RAID_DATA: $temp_array"
|
||||||
# echo -e "A_RAID_DATA:\n${A_RAID_DATA[@]}"
|
# echo -e "A_RAID_DATA:\n${temp_array}"
|
||||||
|
|
||||||
eval $LOGFE
|
eval $LOGFE
|
||||||
}
|
}
|
||||||
|
@ -9486,16 +9486,16 @@ print_raid_data()
|
||||||
component=$( sed 's/\[[0-9]\+\]//' <<< $component )
|
component=$( sed 's/\[[0-9]\+\]//' <<< $component )
|
||||||
fi
|
fi
|
||||||
# NOTE: for bsd zfs, states are: ONLINE,DEGRADED,OFFLINE (at least)
|
# NOTE: for bsd zfs, states are: ONLINE,DEGRADED,OFFLINE (at least)
|
||||||
if [[ -n $( grep -Ei '(F|DEGRADED)' <<< $component ) ]];then
|
if [[ -n $( grep -E '(F|DEGRADED)' <<< $component ) ]];then
|
||||||
component=$( sed -e 's/(F)//' -e 's/F//' -e 's/DEGRADED//' <<< $component )
|
component=$( sed -e 's/(F)//' -e 's/F//' -e 's/DEGRADED//' <<< $component )
|
||||||
failed="$failed $component"
|
failed="$failed $component"
|
||||||
component=''
|
component=''
|
||||||
elif [[ -n $( grep -Ei '(S|OFFLINE)' <<< $component ) ]];then
|
elif [[ -n $( grep -E '(S|OFFLINE)' <<< $component ) ]];then
|
||||||
component=$( sed -e 's/(S)//' -e 's/S//' -e 's/OFFLINE//' <<< $component )
|
component=$( sed -e 's/(S)//' -e 's/S//' -e 's/OFFLINE//' <<< $component )
|
||||||
spare="$spare $component"
|
spare="$spare $component"
|
||||||
component=''
|
component=''
|
||||||
else
|
else
|
||||||
device_components=$device_components$component_separator$component
|
device_components="$device_components$component_separator$component"
|
||||||
component_separator=' '
|
component_separator=' '
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
@ -9506,12 +9506,17 @@ print_raid_data()
|
||||||
if [[ $spare != '' ]];then
|
if [[ $spare != '' ]];then
|
||||||
spare=" ${C1}spare${SEP3}${C2}$spare${C2}"
|
spare=" ${C1}spare${SEP3}${C2}$spare${C2}"
|
||||||
fi
|
fi
|
||||||
if [[ $device_components != '' ]];then
|
|
||||||
|
if [[ -n $device_components || -n $spare || -n $failed ]];then
|
||||||
if [[ $B_EXTRA_DATA != 'true' && -z $BSD_TYPE ]];then
|
if [[ $B_EXTRA_DATA != 'true' && -z $BSD_TYPE ]];then
|
||||||
if [[ $device_report != 'N/A' ]];then
|
if [[ $device_report != 'N/A' && -n $device_components ]];then
|
||||||
device_components="$device_report - $device_components"
|
device_components="$device_report - $device_components"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
if [[ $device_components == '' ]];then
|
||||||
|
device_components='none'
|
||||||
|
fi
|
||||||
|
device_components="${C1}online${SEP3}${C2} $device_components"
|
||||||
device_components=" ${C1}components${SEP3}${C2} $device_components$failed$spare"
|
device_components=" ${C1}components${SEP3}${C2} $device_components$failed$spare"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,3 +1,18 @@
|
||||||
|
=====================================================================================
|
||||||
|
Version: 1.8.40
|
||||||
|
Patch Version: 00
|
||||||
|
Script Date: February 27 2013
|
||||||
|
-----------------------------------
|
||||||
|
Changes:
|
||||||
|
-----------------------------------
|
||||||
|
New version, bug fix for mdraid, and cleaned up some errors and weak spots in component
|
||||||
|
output for mdraid. Certain conditions would trigger a false return for raid components, now
|
||||||
|
it shows more explicitly the online/spare/failed data so it's clear. Also shows 'none' for
|
||||||
|
online if none are detected.
|
||||||
|
|
||||||
|
-----------------------------------
|
||||||
|
-- Harald Hope - Wed, 27 Feb 2013 14:00:46 -0800
|
||||||
|
|
||||||
=====================================================================================
|
=====================================================================================
|
||||||
Version: 1.8.39
|
Version: 1.8.39
|
||||||
Patch Version: 00
|
Patch Version: 00
|
||||||
|
|
Loading…
Reference in a new issue