Merge pull request #22 from philcryer/centos55

added mail option for centos 5.5
This commit is contained in:
zertrin 2012-09-26 07:26:39 -07:00
commit 02fe192295
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