summaryrefslogtreecommitdiff
path: root/bin/extra/ntfy
blob: 0522499e829831014e5ae05e7f947de06d1974b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh

which jq > /dev/null || exit 1

[ "$1" ] || exit 1

curl -s -N "http://debuc.com:32336/$1/json?since=60m" |
while read -r notification
do 
	s="$(printf '%s' "$notification" | jq -r -c '"\(.title)@@@@@\(.message)"')"
	message="${s#*@@@@@}"
	title="${s%%@@@@@*}"
	[ "$message" = "null" ] && [ "$title" = "null" ] && continue
	herbe "$title" "$message" &
done