From 012e7f58d260fc310011e5e1830946eb4cf2237b Mon Sep 17 00:00:00 2001 From: meftimes Date: Sat, 10 Feb 2024 23:11:02 -0500 Subject: [PATCH] add notify script --- media-stack/notify-downloads.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 media-stack/notify-downloads.sh diff --git a/media-stack/notify-downloads.sh b/media-stack/notify-downloads.sh new file mode 100755 index 0000000..e1c8a1c --- /dev/null +++ b/media-stack/notify-downloads.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +inotifywait -m ./testinotify -e create -e moved_to | + while read dir file; do + curl \ + -u :ntfy_token_goes_here \ + -H "Priority: urgent" \ + -H "Tags: arrow_down" \ + -H "Title: Download Complete" \ + -d "$file" \ + https://ntfy_url_goes_here + done + +# Source: https://unix.stackexchange.com/questions/24952/tool-to-monitor-folder-for-new-files-and-run-command-whenever-new-file-is-detect