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 # command to use to send mail
MAIL="mailx" MAIL="mailx"
#MAIL="mail"
#MAIL="ssmtp" #MAIL="ssmtp"
# TROUBLESHOOTING: If you are having any problems running this script it is # TROUBLESHOOTING: If you are having any problems running this script it is

View file

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