commit abafd62c5cfcbc2a6c54345b583869b19faf3636 Author: Thorsten Date: Mon Dec 16 20:49:41 2024 +0100 Initial commit diff --git a/shell_ntfy_paperless.sh b/shell_ntfy_paperless.sh new file mode 100644 index 0000000..15b6514 --- /dev/null +++ b/shell_ntfy_paperless.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# Variablen +FILE_PATH="/home/thorsten/Schreibtisch/Neuer Ordner/gotify.png" +FILE_NAME="gotify.png" +SERVER_URL="http://192.168.178.25:5885/attachments" +AUTH_TOKEN="tk_jtt0zcnmephixstrp9tleb6klf0zu" + +# Curl Befehl ausführen und die Antwort speichern +RESPONSE=$(curl -s -X PUT "$SERVER_URL" \ + -H "Authorization: Bearer $AUTH_TOKEN" \ + -T "$FILE_PATH" \ + -H "Filename: $FILE_NAME") + +# URL aus der Antwort extrahieren +URL=$(echo $RESPONSE | jq -r '.url') + +# Ergebnis anzeigen +echo "Datei hochgeladen. Zugriff auf die Datei unter: $URL" \ No newline at end of file