Update script
This commit is contained in:
parent
cc1b58f90f
commit
cc98edab6c
1 changed files with 3 additions and 3 deletions
|
@ -220,7 +220,7 @@
|
||||||
end
|
end
|
||||||
|
|
||||||
# --- Read Piped Input ---
|
# --- Read Piped Input ---
|
||||||
set -l message_body "Command completed"
|
set -l message_body "$(date)\n Command completed"
|
||||||
|
|
||||||
# --- Manual JSON Escaping ---
|
# --- Manual JSON Escaping ---
|
||||||
set -l escaped_subject (string replace -a '\\' '\\\\' "$subject" | string replace -a '"' '\\"')
|
set -l escaped_subject (string replace -a '\\' '\\\\' "$subject" | string replace -a '"' '\\"')
|
||||||
|
@ -231,11 +231,11 @@
|
||||||
"$escaped_subject" "$escaped_message" $priority)
|
"$escaped_subject" "$escaped_message" $priority)
|
||||||
|
|
||||||
# --- Execute curl (Verbose, Foreground) ---
|
# --- Execute curl (Verbose, Foreground) ---
|
||||||
echo $json_payload | curl -v -X POST \
|
echo $json_payload | curl -X POST \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-H "X-Gotify-Key: $gotify_token" \
|
-H "X-Gotify-Key: $gotify_token" \
|
||||||
--data @- \
|
--data @- \
|
||||||
"$gotify_url/message"
|
"$gotify_url/message" > /dev/null
|
||||||
|
|
||||||
# --- Check curl Status ---
|
# --- Check curl Status ---
|
||||||
set curl_status $status
|
set curl_status $status
|
||||||
|
|
Loading…
Add table
Reference in a new issue