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