containers-monit/email.sh

16 lines
300 B
Bash
Raw Normal View History

2022-03-07 23:28:42 +00:00
#!/bin/sh
set -e
test ! -f /etc/monit.d/email.conf || exit 0
test -n "${EMAIL}"
test -n "${EMAIL_FROM}"
sed -re "s/@@EMAIL@@/${EMAIL}/" \
-e "s/@@EMAIL_FROM@@/${EMAIL_FROM}/" \
-e "s/@@HOSTNAME@@/${EMAIL_FROM#*@}/" \
/etc/email.conf > /etc/monit.d/email.conf
monit -t
monit reload