containers-rails/zeroconf.sh

21 lines
483 B
Bash
Raw Permalink Normal View History

2022-03-07 23:28:42 +00:00
#!/bin/sh
set -e
2022-03-14 02:27:39 +00:00
test ! -f /etc/monit.d/zeroconf.conf || exit 0
2022-03-07 23:28:42 +00:00
test -n "${EMAIL}"
test -n "${EMAIL_FROM}"
2022-03-14 02:27:39 +00:00
test -n "${MMONIT}"
2022-03-14 21:34:00 +00:00
test -n "${CREDENTIALS}"
2022-03-07 23:28:42 +00:00
sed -re "s/@@EMAIL@@/${EMAIL}/" \
-e "s/@@EMAIL_FROM@@/${EMAIL_FROM}/" \
-e "s/@@HOSTNAME@@/${EMAIL_FROM#*@}/" \
2022-03-14 02:27:39 +00:00
-e "s/@@MMONIT@@/${MMONIT}/" \
2022-03-14 21:34:00 +00:00
-e "s/@@CREDENTIALS@@/${CREDENTIALS}/" \
2023-04-19 17:35:47 +00:00
-e "s/@@POSTFIX@@/${POSTFIX:-postfix}/" \
2022-03-14 02:27:39 +00:00
/etc/zeroconf.conf > /etc/monit.d/zeroconf.conf
2022-03-07 23:28:42 +00:00
monit -t
monit reload