Browse Source

_subject/_content passed through json encoder, 'borrowed' the _H1 line from slack.sh to specify content type

pull/2325/head
Daniel Kearns 7 years ago
parent
commit
8f2a8a8383
  1. 5
      notify/pushover.sh

5
notify/pushover.sh

@ -1,6 +1,6 @@
#!/usr/bin/env sh #!/usr/bin/env sh
#Support PUSHOVER.com api
#Support for pushover.net's api. Push notification platform for multiple platforms
PUSHOVER_URI="https://api.pushover.net/1/messages.json" PUSHOVER_URI="https://api.pushover.net/1/messages.json"
@ -32,6 +32,9 @@ pushover_send() {
fi fi
_saveaccountconf_mutable PUSHOVER_SOUND "$PUSHOVER_SOUND" _saveaccountconf_mutable PUSHOVER_SOUND "$PUSHOVER_SOUND"
export _H1="Content-Type: application/json"
_content="$(printf "*%s*\n" "$_content" | _json_encode)"
_subject="$(printf "*%s*\n" "$_subject" | _json_encode)"
_data="{\"token\": \"$PUSHOVER_TOKEN\",\"user\": \"$PUSHOVER_USER\",\"title\": \"$_subject\",\"message\": \"$_content\",\"sound\": \"$PUSHOVER_SOUND\"}" _data="{\"token\": \"$PUSHOVER_TOKEN\",\"user\": \"$PUSHOVER_USER\",\"title\": \"$_subject\",\"message\": \"$_content\",\"sound\": \"$PUSHOVER_SOUND\"}"
response="" #just make shellcheck happy response="" #just make shellcheck happy

Loading…
Cancel
Save