[Watchdog] add curl verbose & use | as sed delimiter

This commit is contained in:
FreddleSpl0it 2023-12-11 15:44:11 +01:00
parent a3c5f785e9
commit 218ba69501
No known key found for this signature in database
GPG Key ID: 00E14E7634F4BEC5
2 changed files with 5 additions and 3 deletions

View File

@ -19,9 +19,11 @@ fi
if [[ "${WATCHDOG_VERBOSE}" =~ ^([yY][eE][sS]|[yY])+$ ]]; then if [[ "${WATCHDOG_VERBOSE}" =~ ^([yY][eE][sS]|[yY])+$ ]]; then
SMTP_VERBOSE="--verbose" SMTP_VERBOSE="--verbose"
CURL_VERBOSE="--verbose"
set -xv set -xv
else else
SMTP_VERBOSE="" SMTP_VERBOSE=""
CURL_VERBOSE=""
exec 2>/dev/null exec 2>/dev/null
fi fi
@ -168,10 +170,10 @@ function notify_error() {
fi fi
# Replace subject and body placeholders # Replace subject and body placeholders
WEBHOOK_BODY=$(echo ${WATCHDOG_NOTIFY_WEBHOOK_BODY} | sed "s/\$SUBJECT\|\${SUBJECT}/$SUBJECT/g" | sed "s/\$BODY\|\${BODY}/$BODY/") WEBHOOK_BODY=$(echo ${WATCHDOG_NOTIFY_WEBHOOK_BODY} | sed "s|\$SUBJECT\|\${SUBJECT}|$SUBJECT|g" | sed "s|\$BODY\|\${BODY}|$BODY|")
# POST to webhook # POST to webhook
curl -X POST -H "Content-Type: application/json" -d "${WEBHOOK_BODY}" ${WATCHDOG_NOTIFY_WEBHOOK} curl -X POST -H "Content-Type: application/json" ${CURL_VERBOSE} -d "${WEBHOOK_BODY}" ${WATCHDOG_NOTIFY_WEBHOOK}
log_msg "Sent notification using webhook" log_msg "Sent notification using webhook"
fi fi

View File

@ -448,7 +448,7 @@ services:
- /lib/modules:/lib/modules:ro - /lib/modules:/lib/modules:ro
watchdog-mailcow: watchdog-mailcow:
image: mailcow/watchdog:1.97 image: mailcow/watchdog:1.99
dns: dns:
- ${IPV4_NETWORK:-172.22.1}.254 - ${IPV4_NETWORK:-172.22.1}.254
tmpfs: tmpfs: