2020-08-15 23:06:43 +00:00
|
|
|
function send_push -a message -d 'Send a push notification to your phone via pushover (optional delay as second arg)'
|
2020-10-31 22:13:25 +00:00
|
|
|
if test -n "$argv[2]"
|
|
|
|
sleep $argv[2]
|
|
|
|
end
|
2020-08-15 23:06:43 +00:00
|
|
|
|
2020-10-31 22:13:25 +00:00
|
|
|
set payload \
|
|
|
|
"{
|
2020-08-15 23:20:08 +00:00
|
|
|
\"token\": \"$pushover_token\",
|
|
|
|
\"user\": \"$pushover_user\",
|
|
|
|
\"title\": \"Tasks\",
|
|
|
|
\"message\": $message
|
|
|
|
}"
|
2020-08-15 23:06:43 +00:00
|
|
|
|
2020-10-31 22:13:25 +00:00
|
|
|
curl \
|
|
|
|
-X POST \
|
|
|
|
-H 'Content-Type: application/json' \
|
|
|
|
-d $payload \
|
|
|
|
https://api.pushover.net/1/messages.json
|
2020-08-15 23:06:43 +00:00
|
|
|
end
|