Super simple and small Web Push and Notification service
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

19 lines
438 B

  1. #!/bin/sh -
  2. subinfo="$1"
  3. if ! [ -f "$1" ] || [ $# != 1 ]; then
  4. echo "Usage: $0 <subinfo>"
  5. exit 1
  6. fi
  7. tmpfname="tmp.pushinfo.$$"
  8. cat - > "$tmpfname"
  9. title=$(grep -i "^Subject:" "$tmpfname" | sed -e 's/.*:[ ]*//')
  10. jq --rawfile msg "$tmpfname" --arg title "$title" -n '{ "title": $title, "body": $msg, "icon" : "static/i-ico.png", "image" : "static/i-banner.png" }' |
  11. pywebpush -v --data /dev/stdin --info "$subinfo"
  12. rm "$tmpfname"