Replace placeholders with sed

This commit is contained in:
Felix Kleinekathöfer 2023-01-07 15:44:29 +01:00 committed by GitHub
parent 3e69304f0f
commit b83841d253
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -167,7 +167,7 @@ function notify_error() {
return 1
fi
WEBHOOK_BODY=$(echo "${WATCHDOG_NOTIFY_WEBHOOK_BODY}" | envsubst '$SUBJECT,$BODY')
WEBHOOK_BODY=$(echo ${WATCHDOG_NOTIFY_WEBHOOK_BODY} | sed "s/\$SUBJECT\|\${SUBJECT}/$SUBJECT/g" | sed "s/\$BODY\|\${BODY}/$BODY/" | sed "s/\"/\\\\\"/g")
curl -X POST \
-H "Content-Type: application/json" \