Bugfix: regresion: SMART attributes after badblocks killed clears ERROR
This commit is contained in:
parent
baecf3a314
commit
a5e247b20c
1 changed files with 20 additions and 18 deletions
|
@ -109,24 +109,26 @@ if [[ -z $ERROR ]] ; then
|
|||
#fi
|
||||
sleep $SMARTLOG
|
||||
done
|
||||
# Check smart attributes after the badblocks test
|
||||
ERROR=`smartctl -A -f brief /dev/$DISK \
|
||||
| parse-smart-attr \
|
||||
| grep ERROR \
|
||||
| cut -d ':' -f 2
|
||||
`
|
||||
# TODO: Debug variable. Comment out for production
|
||||
#ERROR=
|
||||
if [[ -n $ERROR ]] ; then
|
||||
RAW_ERROR=$ERROR
|
||||
ERROR=''
|
||||
for TOKEN in $RAW_ERROR ; do
|
||||
ERROR="$ERROR $TOKEN"
|
||||
done
|
||||
smartctl -A -f brief /dev/$DISK \
|
||||
| parse-smart-attr \
|
||||
| sed "s/ERROR/$RES_ERROR/g" \
|
||||
> $OUTPUT_DIR/disk/$SERIAL.smart.error
|
||||
if [[ -z $ERROR ]] ; then
|
||||
# Check smart attributes after the badblocks test
|
||||
ERROR=`smartctl -A -f brief /dev/$DISK \
|
||||
| parse-smart-attr \
|
||||
| grep ERROR \
|
||||
| cut -d ':' -f 2
|
||||
`
|
||||
# TODO: Debug variable. Comment out for production
|
||||
#ERROR=
|
||||
if [[ -n $ERROR ]] ; then
|
||||
RAW_ERROR=$ERROR
|
||||
ERROR=''
|
||||
for TOKEN in $RAW_ERROR ; do
|
||||
ERROR="$ERROR $TOKEN"
|
||||
done
|
||||
smartctl -A -f brief /dev/$DISK \
|
||||
| parse-smart-attr \
|
||||
| sed "s/ERROR/$RES_ERROR/g" \
|
||||
> $OUTPUT_DIR/disk/$SERIAL.smart.error
|
||||
fi
|
||||
fi
|
||||
#RET=$?
|
||||
#echo $RET > $OUTPUT_DIR/disk/$SERIAL.badblocks.ret
|
||||
|
|
Loading…
Reference in a new issue