added mail option for centos 55

This commit is contained in:
pcryer 2012-09-24 13:07:05 -05:00
parent d8de5f0bdd
commit 3f254e821d
2 changed files with 4 additions and 1 deletions

View file

@ -160,6 +160,7 @@ EMAIL_SUBJECT=
# command to use to send mail
MAIL="mailx"
#MAIL="mail"
#MAIL="ssmtp"
# TROUBLESHOOTING: If you are having any problems running this script it is

View file

@ -241,7 +241,9 @@ email_logfile()
elif [ "$MAIL" = "mailx" ]; then
EMAIL_FROM=${EMAIL_FROM:+"-r ${EMAIL_FROM}"}
cat ${LOGFILE} | ${MAILCMD} -s """${EMAIL_SUBJECT}""" $EMAIL_FROM ${EMAIL_TO}
fi
elif [ "$MAIL" = "mail" ]; then
cat ${LOGFILE} | ${MAILCMD} -s """${EMAIL_SUBJECT}""" $EMAIL_FROM ${EMAIL_TO} -- -f ${EMAIL_FROM}
fi
echo -e "Email alert sent to ${EMAIL_TO} using ${MAIL}" >> ${LOGFILE}
fi
fi