$ICON is now optional

This commit is contained in:
2024-12-21 18:13:46 +01:00
parent 4cd6972aff
commit a185c38da3
3 changed files with 15 additions and 13 deletions

View File

@@ -112,15 +112,15 @@ if should_notify "$DUPLICATI__PARSED_RESULT"; then
CURL_CMD="curl -s -X POST \"$NTFY_URL\" \
-H \"Authorization: Bearer $AUTH_TOKEN\" \
-H \"Priority: $PRIORITY\" \
-H \"Tags: $TAGS\" \
-H \"Icon: $ICON\" \
-H \"Content-Type: application/json\" \
-d '{\"topic\": \"Duplicati\", \"title\": \"$TITLE\", \"message\": \"$MESSAGE\\n\\nServer: $SERVER_NAME\\nJobname: $DUPLICATI__backup_name\\nStatus: $DUPLICATI__PARSED_RESULT\", \"click\": \"\", \"actions\": [{ \"action\": \"view\", \"label\": \"Duplicati öffnen\", \"url\": \"$DUPLICATI_URL\" }]}'
"
-H \"Tags: $TAGS\""
if [ -n "$ICON" ]; then
CURL_CMD="$CURL_CMD -H \"Icon: $ICON\""
fi
CURL_CMD="$CURL_CMD -H \"Content-Type: application/json\" \
-d '{\"topic\": \"Duplicati\", \"title\": \"$TITLE\", \"message\": \"$MESSAGE\\n\\nServer: $SERVER_NAME\\nJobname: $DUPLICATI__backup_name\\nStatus: $DUPLICATI__PARSED_RESULT\", \"click\": \"\", \"actions\": [{ \"action\": \"view\", \"label\": \"Duplicati öffnen\", \"url\": \"$DUPLICATI_URL\" }]}'"
# Log den curl-Befehl
if [[ "$LOGGING" == "debug" ]]; then
log_message "curl Befehl: $CURL_CMD"
fi