fix some parsing of smart-intercept-spindown broken by new version
New smart-intercept-spindown didn't accept all formats of input coming to it - the status line we were trying to detect broken status of doesn't appear on most devices
This commit is contained in:
parent
f8e4bf0dc8
commit
8ea6df0eb3
2 changed files with 83 additions and 73 deletions
|
|
@ -404,8 +404,8 @@ sub set_fans_servo {
|
|||
# to tiny spikes of 1 fan unit. FIXME: But should implement long
|
||||
# term smoothing of +/- 1 fan unit
|
||||
my $demand_has_changed = !defined $lastfan or
|
||||
$demand < $lastfan or
|
||||
$demand > $lastfan + $hysteresis;
|
||||
($demand < $lastfan) or
|
||||
($demand > $lastfan + $hysteresis);
|
||||
if ($print_stats or
|
||||
$demand_has_changed) {
|
||||
if ($demand_has_changed) {
|
||||
|
|
|
|||
|
|
@ -24,7 +24,10 @@ convert_sas() {
|
|||
device_product=
|
||||
data=
|
||||
local exit_code=0
|
||||
while read line ; do
|
||||
exit_condition=false
|
||||
{
|
||||
read line || exit_condition=true
|
||||
while ! $exit_condition ; do
|
||||
case "$read_initial,$read_data,$line" in
|
||||
true,false,*DATA\ SECTION*)
|
||||
read_initial=false
|
||||
|
|
@ -34,14 +37,19 @@ convert_sas() {
|
|||
echo "$line"
|
||||
|
||||
read line
|
||||
if [[ "$line" == SMART\ Health\ Status:*OK ]] ; then
|
||||
if [[ "$line" == SMART\ Health\ Status: ]] ; then
|
||||
if [[ "$line" == *OK ]] ; then
|
||||
exit_code=0
|
||||
else
|
||||
exit_code=8
|
||||
fi
|
||||
echo "$line"
|
||||
echo
|
||||
read line
|
||||
fi
|
||||
|
||||
echo "ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE"
|
||||
continue # reparse the new line
|
||||
;;
|
||||
true,false,Vendor:*)
|
||||
device_vendor="$( echo "$line" | sed 's/Vendor: *//' )"
|
||||
|
|
@ -97,7 +105,9 @@ convert_sas() {
|
|||
$line"
|
||||
;;
|
||||
esac
|
||||
done <<< "$1"
|
||||
read line || exit_condition=true
|
||||
done
|
||||
} <<< "$1"
|
||||
if [ -n "$data" ] ; then
|
||||
echo
|
||||
echo "=== SAS DATA ==="
|
||||
|
|
|
|||
Loading…
Reference in a new issue