Only sent mail if enabled

This commit is contained in:
Felix Kleinekathöfer 2023-01-06 15:52:36 +01:00 committed by GitHub
parent 9ef14a20d1
commit fe8131f743
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -124,6 +124,8 @@ function notify_error() {
else else
SUBJECT="${WATCHDOG_SUBJECT}: ${1}" SUBJECT="${WATCHDOG_SUBJECT}: ${1}"
fi fi
if [[ ! -z ${WATCHDOG_NOTIFY_EMAIL} ]]; then
IFS=',' read -r -a MAIL_RCPTS <<< "${WATCHDOG_NOTIFY_EMAIL}" IFS=',' read -r -a MAIL_RCPTS <<< "${WATCHDOG_NOTIFY_EMAIL}"
for rcpt in "${MAIL_RCPTS[@]}"; do for rcpt in "${MAIL_RCPTS[@]}"; do
RCPT_DOMAIN= RCPT_DOMAIN=
@ -155,6 +157,7 @@ function notify_error() {
fi fi
fi fi
done done
fi
} }
get_container_ip() { get_container_ip() {