added mail option for centos 55
This commit is contained in:
parent
d8de5f0bdd
commit
3f254e821d
2 changed files with 4 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue