Rely on megaclisas-status exit code instead of output (Refs: #99)

This commit is contained in:
Adam Cecile 2019-07-03 13:58:39 +02:00
parent dfe63bf478
commit f40f5bcd6e

View File

@ -47,11 +47,11 @@ check_megaclisas() {
# Check ever $PERIOD seconds, send email on every status
# change and repeat ever $REMIND seconds if the raid is still
# bad.
if (megaclisas-status --notemp) |grep -q 'NOT OPTIMAL' ; then
if (megaclisas-status --notemp); then
BADRAID=false
else
BADRAID=true
logger -t megaclisas-statusd "detected non-optimal RAID status"
else
BADRAID=false
fi
STATUSCHANGE=false
if [ true = "$BADRAID" ] ; then