docker/media-stack/notify-downloads.sh

17 lines
615 B
Bash
Raw Normal View History

2024-02-11 04:11:02 +00:00
#!/bin/bash
2024-02-13 02:39:00 +00:00
inotifywait -m ./path -e create -e moved_to |
while read file; do
TITLE=$(echo "$file" | awk '{$1=""; print $0}') #formatting
2024-02-11 04:11:02 +00:00
curl \
-u :ntfy_token_goes_here \
-H "Priority: urgent" \
-H "Tags: arrow_down" \
-H "Title: Download Complete" \
2024-02-13 02:39:00 +00:00
-d "$TITLE" \
2024-02-11 04:11:02 +00:00
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
2024-02-13 02:39:00 +00:00
# Source: https://stackoverflow.com/questions/2961635/using-awk-to-print-all-columns-from-the-nth-to-the-last