Update script

This commit is contained in:
albert 2025-04-21 11:47:43 +02:00
parent cc1b58f90f
commit cc98edab6c
Signed by: albert
GPG key ID: 3895DD267CA11BA9

View file

@ -220,7 +220,7 @@
end
# --- Read Piped Input ---
set -l message_body "Command completed"
set -l message_body "$(date)\n Command completed"
# --- Manual JSON Escaping ---
set -l escaped_subject (string replace -a '\\' '\\\\' "$subject" | string replace -a '"' '\\"')
@ -231,11 +231,11 @@
"$escaped_subject" "$escaped_message" $priority)
# --- Execute curl (Verbose, Foreground) ---
echo $json_payload | curl -v -X POST \
echo $json_payload | curl -X POST \
-H "Content-Type: application/json" \
-H "X-Gotify-Key: $gotify_token" \
--data @- \
"$gotify_url/message"
"$gotify_url/message" > /dev/null
# --- Check curl Status ---
set curl_status $status