From 435c7f8ed5be3c2d2433b22bc66aa2e3dd46568a Mon Sep 17 00:00:00 2001 From: meftimes Date: Mon, 12 Feb 2024 21:39:00 -0500 Subject: [PATCH] formatting --- media-stack/notify-downloads.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/media-stack/notify-downloads.sh b/media-stack/notify-downloads.sh index e1c8a1c..1d88106 100755 --- a/media-stack/notify-downloads.sh +++ b/media-stack/notify-downloads.sh @@ -1,14 +1,16 @@ #!/bin/bash -inotifywait -m ./testinotify -e create -e moved_to | - while read dir file; do +inotifywait -m ./path -e create -e moved_to | + while read file; do + TITLE=$(echo "$file" | awk '{$1=""; print $0}') #formatting curl \ -u :ntfy_token_goes_here \ -H "Priority: urgent" \ -H "Tags: arrow_down" \ -H "Title: Download Complete" \ - -d "$file" \ + -d "$TITLE" \ 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 +# Source: https://stackoverflow.com/questions/2961635/using-awk-to-print-all-columns-from-the-nth-to-the-last