diff options
Diffstat (limited to 'bin/extra/ntfy')
-rwxr-xr-x | bin/extra/ntfy | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/bin/extra/ntfy b/bin/extra/ntfy new file mode 100755 index 0000000..0522499 --- /dev/null +++ b/bin/extra/ntfy @@ -0,0 +1,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 |