From 91ff4aaaa7777cccd0eacb96f8db614a95cb3bba Mon Sep 17 00:00:00 2001 From: mag37 Date: Wed, 2 Oct 2024 20:44:32 +0200 Subject: [PATCH] Added notification release notes url function --- notify_templates/releasenotes.sh | 17 +++++++++++++++++ notify_templates/urls.list | 3 +++ 2 files changed, 20 insertions(+) create mode 100644 notify_templates/releasenotes.sh create mode 100644 notify_templates/urls.list diff --git a/notify_templates/releasenotes.sh b/notify_templates/releasenotes.sh new file mode 100644 index 0000000..92fe53f --- /dev/null +++ b/notify_templates/releasenotes.sh @@ -0,0 +1,17 @@ +### Snippet to use together with notify.sh +# +# Requires a space-separated list-file of container-name and release-note-url, modify the example file "urls.list" +# Copy urls.list and releasenotes.sh to the same directory as dockcheck.sh. +# +# Add the next line (uncommented) to any notification script you're using, after the "UpdToString"-variable setup +# [ -s "$ScriptWorkDir"/releasenotes.sh ] && { source "$ScriptWorkDir"/releasenotes.sh ; UpdToString=$( releasenotes ) ; } + +releasenotes() { + for update in ${Updates[@]}; do + found=false + while read -r container url; do + [[ $update == $container ]] && printf "%s -> %s\n" "$update" "$url" && found=true + done < urls.list + [[ $found == false ]] && printf "%s\n" "$update" + done +} diff --git a/notify_templates/urls.list b/notify_templates/urls.list new file mode 100644 index 0000000..c8faef1 --- /dev/null +++ b/notify_templates/urls.list @@ -0,0 +1,3 @@ +apprise-api https://github.com/linuxserver/docker-apprise-api/releases +homer https://github.com/bastienwirtz/homer/releases +nginx https://github.com/docker-library/official-images/blob/master/library/nginx