16 lines
300 B
Bash
16 lines
300 B
Bash
|
#!/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
|