$ICON is now optional
This commit is contained in:
@@ -24,15 +24,16 @@ AUTH_TOKEN=tk_dd5geasc9844jcm3d45adio3rtchs
|
||||
#Duplicati Server
|
||||
DUPLICATI_URL=http://192.168.178.25:8200
|
||||
SERVER_NAME=n100
|
||||
|
||||
# NTFY Icon (Optional / Leer lassen falls nicht benötigt)
|
||||
ICON=http://192.168.178.25:3030/icons/n100.png
|
||||
|
||||
# Zustände, die Benachrichtigungen auslösen
|
||||
# (Success, Warning, Error, Fatal, Unknown)
|
||||
SEND_NOTIFICATIONS="Fatal Unknown"
|
||||
SEND_NOTIFICATIONS="Error Fatal Unknown"
|
||||
|
||||
# Optional kann bei jedem Ausführen des Scripts ein Logeintrag erstellt werden.
|
||||
# Wählen Sie das Logging level. Möglich Werte: off, normal, debug
|
||||
# Die Logdatei wird im gleichen Verzeichnis wie das Script selbst gespeichert.
|
||||
# (off, normal, debug)
|
||||
LOGGING=off
|
||||
```
|
||||
|
||||
|
||||
@@ -5,13 +5,14 @@ AUTH_TOKEN=tk_elwqvm6niscdn30f45iksdfh6sope
|
||||
#Duplicati Server
|
||||
DUPLICATI_URL=http://192.168.178.25:8200
|
||||
SERVER_NAME=n100
|
||||
|
||||
# NTFY Icon (Optional / Leer lassen falls nicht benötigt)
|
||||
ICON=http://192.168.178.25:3030/icons/n100.png
|
||||
|
||||
# Zustände, die Benachrichtigungen auslösen
|
||||
# (Success, Warning, Error, Fatal, Unknown)
|
||||
SEND_NOTIFICATIONS="Fatal Error Unknown"
|
||||
|
||||
# Optional kann bei jedem Ausführen des Scripts ein Logeintrag erstellt werden.
|
||||
# Wählen Sie das Logging level. Möglich Werte: off, normal, debug
|
||||
# Die Logdatei wird im gleichen Verzeichnis wie das Script selbst gespeichert.
|
||||
# (off, normal, debug)
|
||||
LOGGING=off
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user