$ICON is now optional
This commit is contained in:
@@ -24,15 +24,16 @@ AUTH_TOKEN=tk_dd5geasc9844jcm3d45adio3rtchs
|
|||||||
#Duplicati Server
|
#Duplicati Server
|
||||||
DUPLICATI_URL=http://192.168.178.25:8200
|
DUPLICATI_URL=http://192.168.178.25:8200
|
||||||
SERVER_NAME=n100
|
SERVER_NAME=n100
|
||||||
|
|
||||||
|
# NTFY Icon (Optional / Leer lassen falls nicht benötigt)
|
||||||
ICON=http://192.168.178.25:3030/icons/n100.png
|
ICON=http://192.168.178.25:3030/icons/n100.png
|
||||||
|
|
||||||
# Zustände, die Benachrichtigungen auslösen
|
# Zustände, die Benachrichtigungen auslösen
|
||||||
# (Success, Warning, Error, Fatal, Unknown)
|
# (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.
|
# Die Logdatei wird im gleichen Verzeichnis wie das Script selbst gespeichert.
|
||||||
# (off, normal, debug)
|
|
||||||
LOGGING=off
|
LOGGING=off
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -5,13 +5,14 @@ AUTH_TOKEN=tk_elwqvm6niscdn30f45iksdfh6sope
|
|||||||
#Duplicati Server
|
#Duplicati Server
|
||||||
DUPLICATI_URL=http://192.168.178.25:8200
|
DUPLICATI_URL=http://192.168.178.25:8200
|
||||||
SERVER_NAME=n100
|
SERVER_NAME=n100
|
||||||
|
|
||||||
|
# NTFY Icon (Optional / Leer lassen falls nicht benötigt)
|
||||||
ICON=http://192.168.178.25:3030/icons/n100.png
|
ICON=http://192.168.178.25:3030/icons/n100.png
|
||||||
|
|
||||||
# Zustände, die Benachrichtigungen auslösen
|
# Zustände, die Benachrichtigungen auslösen
|
||||||
# (Success, Warning, Error, Fatal, Unknown)
|
# (Success, Warning, Error, Fatal, Unknown)
|
||||||
SEND_NOTIFICATIONS="Fatal Error 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.
|
# Die Logdatei wird im gleichen Verzeichnis wie das Script selbst gespeichert.
|
||||||
# (off, normal, debug)
|
|
||||||
LOGGING=off
|
LOGGING=off
|
||||||
|
|||||||
@@ -112,15 +112,15 @@ if should_notify "$DUPLICATI__PARSED_RESULT"; then
|
|||||||
CURL_CMD="curl -s -X POST \"$NTFY_URL\" \
|
CURL_CMD="curl -s -X POST \"$NTFY_URL\" \
|
||||||
-H \"Authorization: Bearer $AUTH_TOKEN\" \
|
-H \"Authorization: Bearer $AUTH_TOKEN\" \
|
||||||
-H \"Priority: $PRIORITY\" \
|
-H \"Priority: $PRIORITY\" \
|
||||||
-H \"Tags: $TAGS\" \
|
-H \"Tags: $TAGS\""
|
||||||
-H \"Icon: $ICON\" \
|
if [ -n "$ICON" ]; then
|
||||||
-H \"Content-Type: application/json\" \
|
CURL_CMD="$CURL_CMD -H \"Icon: $ICON\""
|
||||||
-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\" }]}'
|
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
|
# Log den curl-Befehl
|
||||||
|
|
||||||
|
|
||||||
if [[ "$LOGGING" == "debug" ]]; then
|
if [[ "$LOGGING" == "debug" ]]; then
|
||||||
log_message "curl Befehl: $CURL_CMD"
|
log_message "curl Befehl: $CURL_CMD"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user