summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-06-25 02:18:55 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-06-25 02:18:55 +0200
commitee09323cbc40686b45c716e8468a56ebcf031edf (patch)
treea407c39dd4c8d6f134b8ab3ba805a1338ad4eaa7 /bin
parent3a94266b83e4cee949304b504d5d439e5ee0e30f (diff)
checkpoint
Diffstat (limited to 'bin')
-rwxr-xr-xbin/extra/ntfy15
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