diff --git a/notify_templates/notify_DSM.sh b/notify_templates/notify_DSM.sh index 548a923..ddbc2c6 100644 --- a/notify_templates/notify_DSM.sh +++ b/notify_templates/notify_DSM.sh @@ -71,12 +71,12 @@ dockcheck_notification() { # Setting the MessageBody variable here. printf -v MessageBody "Installed version: $1\nLatest version: $2\n\nChangenotes: $3\n" - RawNotifyUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/notify_templates/notify_DSM.sh" - LatestNotifyRelease="$(curl -s -r 0-150 $RawNotifyUrl | sed -n "/NOTIFY_DSM_VERSION/s/NOTIFY_DSM_VERSION=//p" | tr -d '"')" - if [[ "$NOTIFY_DSM_VERSION" != "$LatestNotifyRelease" ]] ; then - printf -v NotifyUpdate "\n\nNOTIFY_DSM update avialable:\n $NOTIFY_DSM_VERSION -> $LatestNotifyRelease\n" - MessageBody="${MessageBody}${NotifyUpdate}" - fi + RawNotifyUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/notify_templates/notify_DSM.sh" + LatestNotifyRelease="$(curl -s -r 0-150 $RawNotifyUrl | sed -n "/NOTIFY_DSM_VERSION/s/NOTIFY_DSM_VERSION=//p" | tr -d '"')" + if [[ "$NOTIFY_DSM_VERSION" != "$LatestNotifyRelease" ]] ; then + printf -v NotifyUpdate "\n\nnotify_DSM.sh update avialable:\n $NOTIFY_DSM_VERSION -> $LatestNotifyRelease\n" + MessageBody="${MessageBody}${NotifyUpdate}" + fi trigger_notification } diff --git a/notify_templates/notify_apprise.sh b/notify_templates/notify_apprise.sh index a687eb9..fef4303 100644 --- a/notify_templates/notify_apprise.sh +++ b/notify_templates/notify_apprise.sh @@ -1,4 +1,5 @@ ### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. +NOTIFY_APPRISE_VERSION="v0.1" # # Copy/rename this file to notify.sh to enable the notification snippet. # Required receiving services must already be set up. @@ -38,10 +39,17 @@ send_notification() { ### to not send notifications when dockcheck itself has updates. dockcheck_notification() { printf "\nSending Apprise dockcheck notification\n" - + MessageTitle="$FromHost - New version of dockcheck available." # Setting the MessageBody variable here. printf -v MessageBody "Installed version: $1 \nLatest version: $2 \n\nChangenotes: $3" - + + RawNotifyUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/notify_templates/notify_apprise.sh" + LatestNotifyRelease="$(curl -s -r 0-150 $RawNotifyUrl | sed -n "/NOTIFY_APPRISE_VERSION/s/NOTIFY_APPRISE_VERSION=//p" | tr -d '"')" + if [[ "$NOTIFY_APPRISE_VERSION" != "$LatestNotifyRelease" ]] ; then + printf -v NotifyUpdate "\n\nnotify_apprise.sh update avialable:\n $NOTIFY_APPRISE_VERSION -> $LatestNotifyRelease\n" + MessageBody="${MessageBody}${NotifyUpdate}" + fi + trigger_notification } diff --git a/notify_templates/notify_discord.sh b/notify_templates/notify_discord.sh index 2f7f913..5728f74 100644 --- a/notify_templates/notify_discord.sh +++ b/notify_templates/notify_discord.sh @@ -1,4 +1,5 @@ ### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. +NOTIFY_DISCORD_VERSION="v0.1" # # Copy/rename this file to notify.sh to enable the notification snippet. # Required receiving services must already be set up. @@ -31,5 +32,12 @@ dockcheck_notification() { printf "\nSending Discord dockcheck notification\n" MessageBody="$FromHost - New version of dockcheck available: \n Installed version: $1 \nLatest version: $2 \n\nChangenotes: $3" + RawNotifyUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/notify_templates/notify_discord.sh" + LatestNotifyRelease="$(curl -s -r 0-150 $RawNotifyUrl | sed -n "/NOTIFY_DISCORD_VERSION/s/NOTIFY_DISCORD_VERSION=//p" | tr -d '"')" + if [[ "$NOTIFY_DISCORD_VERSION" != "$LatestNotifyRelease" ]] ; then + printf -v NotifyUpdate "\n\nnotify_discord.sh update avialable:\n $NOTIFY_DISCORD_VERSION -> $LatestNotifyRelease\n" + MessageBody="${MessageBody}${NotifyUpdate}" + fi + trigger_notification } diff --git a/notify_templates/notify_generic.sh b/notify_templates/notify_generic.sh index b93c2b2..700e84a 100644 --- a/notify_templates/notify_generic.sh +++ b/notify_templates/notify_generic.sh @@ -1,4 +1,5 @@ ### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. +NOTIFY_GENERIC_VERSION="v0.1" # # Copy/rename this file to notify.sh to enable the notification snippet. # generic sample, the "Hello World" of notification addons @@ -14,12 +15,12 @@ trigger_notification() { send_notification() { [ -s "$ScriptWorkDir"/urls.list ] && releasenotes || Updates=("$@") UpdToString=$( printf '%s\\n' "${Updates[@]}" ) - + # platform specific notification code would go here printf "\n%bGeneric notification addon:%b" "$c_green" "$c_reset" MessageTitle="$FromHost - updates available." printf -v MessageBody "🐋 Containers on $FromHost with updates available:\n$UpdToString" - + trigger_notification } @@ -27,10 +28,17 @@ send_notification() { ### to not send notifications when dockcheck itself has updates. dockcheck_notification() { printf "\nGeneric dockcheck notification\n" - + MessageTitle="$FromHost - New version of dockcheck available." # Setting the MessageBody variable here. printf -v MessageBody "Installed version: $1 \nLatest version: $2 \n\nChangenotes: $3" - + + RawNotifyUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/notify_templates/notify_generic.sh" + LatestNotifyRelease="$(curl -s -r 0-150 $RawNotifyUrl | sed -n "/NOTIFY_GENERIC_VERSION/s/NOTIFY_GENERIC_VERSION=//p" | tr -d '"')" + if [[ "$NOTIFY_GENERIC_VERSION" != "$LatestNotifyRelease" ]] ; then + printf -v NotifyUpdate "\n\nnotify_generic.sh update avialable:\n $NOTIFY_GENERIC_VERSION -> $LatestNotifyRelease\n" + MessageBody="${MessageBody}${NotifyUpdate}" + fi + trigger_notification } diff --git a/notify_templates/notify_gotify.sh b/notify_templates/notify_gotify.sh index d5eae60..3cb4d3e 100644 --- a/notify_templates/notify_gotify.sh +++ b/notify_templates/notify_gotify.sh @@ -1,4 +1,5 @@ ### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. +NOTIFY_GOTIFY_VERSION="v0.1" # # Copy/rename this file to notify.sh to enable the notification snippet. # Required receiving services must already be set up. @@ -41,5 +42,12 @@ dockcheck_notification() { # Setting the MessageBody variable here. printf -v MessageBody "Installed version: $1 \nLatest version: $2 \n\nChangenotes: $3" + RawNotifyUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/notify_templates/notify_gotify.sh" + LatestNotifyRelease="$(curl -s -r 0-150 $RawNotifyUrl | sed -n "/NOTIFY_GOTIFY_VERSION/s/NOTIFY_GOTIFY_VERSION=//p" | tr -d '"')" + if [[ "$NOTIFY_GOTIFY_VERSION" != "$LatestNotifyRelease" ]] ; then + printf -v NotifyUpdate "\n\nnotify_gotify.sh update avialable:\n $NOTIFY_GOTIFY_VERSION -> $LatestNotifyRelease\n" + MessageBody="${MessageBody}${NotifyUpdate}" + fi + trigger_notification } diff --git a/notify_templates/notify_matrix.sh b/notify_templates/notify_matrix.sh index 9279a42..686a4b1 100644 --- a/notify_templates/notify_matrix.sh +++ b/notify_templates/notify_matrix.sh @@ -1,4 +1,5 @@ ### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. +NOTIFY_MATRIX_VERSION="v0.1" # # Copy/rename this file to notify.sh to enable the notification snippet. # Required receiving services must already be set up. @@ -34,10 +35,17 @@ send_notification() { ### to not send notifications when dockcheck itself has updates. dockcheck_notification() { printf "\nSending Matrix dockcheck notification\n" - + MessageTitle="$FromHost - New version of dockcheck available." # Setting the MessageBody variable here. printf -v MessageBody "Installed version: $1 \nLatest version: $2 \n\nChangenotes: $3" - + + RawNotifyUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/notify_templates/notify_matrix.sh" + LatestNotifyRelease="$(curl -s -r 0-150 $RawNotifyUrl | sed -n "/NOTIFY_MATRIX_VERSION/s/NOTIFY_MATRIX_VERSION=//p" | tr -d '"')" + if [[ "$NOTIFY_MATRIX_VERSION" != "$LatestNotifyRelease" ]] ; then + printf -v NotifyUpdate "\n\nnotify_matrix.sh update avialable:\n $NOTIFY_MATRIX_VERSION -> $LatestNotifyRelease\n" + MessageBody="${MessageBody}${NotifyUpdate}" + fi + trigger_notification } diff --git a/notify_templates/notify_ntfy-sh.sh b/notify_templates/notify_ntfy-sh.sh index 68b293b..dc6d24f 100644 --- a/notify_templates/notify_ntfy-sh.sh +++ b/notify_templates/notify_ntfy-sh.sh @@ -1,4 +1,5 @@ ### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. +NOTIFY_NTFYSH_VERSION="v0.1" # # Copy/rename this file to notify.sh to enable the notification snippet. # Setup app and subscription at https://ntfy.sh @@ -33,10 +34,17 @@ send_notification() { ### to not send notifications when dockcheck itself has updates. dockcheck_notification() { printf "\nSending ntfy.sh dockcheck notification\n" - + MessageTitle="$FromHost - New version of dockcheck available." # Setting the MessageBody variable here. printf -v MessageBody "Installed version: $1 \nLatest version: $2 \n\nChangenotes: $3" - + + RawNotifyUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/notify_templates/notify_ntfy-sh.sh" + LatestNotifyRelease="$(curl -s -r 0-150 $RawNotifyUrl | sed -n "/NOTIFY_NTFYSH_VERSION/s/NOTIFY_NTFYSH_VERSION=//p" | tr -d '"')" + if [[ "$NOTIFY_NTFYSH_VERSION" != "$LatestNotifyRelease" ]] ; then + printf -v NotifyUpdate "\n\nnotify_ntfy-sh.sh update avialable:\n $NOTIFY_NTFYSH_VERSION -> $LatestNotifyRelease\n" + MessageBody="${MessageBody}${NotifyUpdate}" + fi + trigger_notification } diff --git a/notify_templates/notify_pushbullet.sh b/notify_templates/notify_pushbullet.sh index 7429e03..0df62cb 100644 --- a/notify_templates/notify_pushbullet.sh +++ b/notify_templates/notify_pushbullet.sh @@ -1,4 +1,5 @@ ### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. +NOTIFY_PUSHBULLET_VERSION="v0.1" # # Copy/rename this file to notify.sh to enable the notification snippet. # Required receiving services must already be set up. @@ -39,5 +40,12 @@ dockcheck_notification() { # Setting the MessageBody variable here. printf -v MessageBody "Installed version: $1 \nLatest version: $2 \n\nChangenotes: $3" + RawNotifyUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/notify_templates/notify_pushbullet.sh" + LatestNotifyRelease="$(curl -s -r 0-150 $RawNotifyUrl | sed -n "/NOTIFY_PUSHBULLET_VERSION/s/NOTIFY_PUSHBULLET_VERSION=//p" | tr -d '"')" + if [[ "$NOTIFY_PUSHBULLET_VERSION" != "$LatestNotifyRelease" ]] ; then + printf -v NotifyUpdate "\n\nnotify_pushbullet.sh update avialable:\n $NOTIFY_PUSHBULLET_VERSION -> $LatestNotifyRelease\n" + MessageBody="${MessageBody}${NotifyUpdate}" + fi + trigger_notification } diff --git a/notify_templates/notify_pushover.sh b/notify_templates/notify_pushover.sh index 69e951f..dc28493 100644 --- a/notify_templates/notify_pushover.sh +++ b/notify_templates/notify_pushover.sh @@ -1,4 +1,5 @@ ### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. +NOTIFY_PUSHOVER_VERSION="v0.1" # # Copy/rename this file to notify.sh to enable the notification snippet. # Required receiving services must already be set up. @@ -40,10 +41,17 @@ send_notification() { ### to not send notifications when dockcheck itself has updates. dockcheck_notification() { printf "\nSending pushover dockcheck notification\n" - + MessageTitle="$FromHost - New version of dockcheck available." # Setting the MessageBody variable here. printf -v MessageBody "Installed version: $1 \nLatest version: $2 \n\nChangenotes: $3" - + + RawNotifyUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/notify_templates/notify_pushover.sh" + LatestNotifyRelease="$(curl -s -r 0-150 $RawNotifyUrl | sed -n "/NOTIFY_PUSHOVER_VERSION/s/NOTIFY_PUSHOVER_VERSION=//p" | tr -d '"')" + if [[ "$NOTIFY_PUSHOVER_VERSION" != "$LatestNotifyRelease" ]] ; then + printf -v NotifyUpdate "\n\nnotify_pushover.sh update avialable:\n $NOTIFY_PUSHOVER_VERSION -> $LatestNotifyRelease\n" + MessageBody="${MessageBody}${NotifyUpdate}" + fi + trigger_notification } diff --git a/notify_templates/notify_smtp.sh b/notify_templates/notify_smtp.sh index 551e434..55e325b 100644 --- a/notify_templates/notify_smtp.sh +++ b/notify_templates/notify_smtp.sh @@ -1,4 +1,5 @@ ### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. +NOTIFY_SMTP_VERSION="v0.1" # INFO: ssmtp is depcerated - consider to use msmtp instead. # # Copy/rename this file to notify.sh to enable the notification snipppet. @@ -59,5 +60,12 @@ dockcheck_notification() { # Setting the MessageBody variable here. printf -v MessageBody "Installed version: $1 \nLatest version: $2 \n\nChangenotes: $3" + RawNotifyUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/notify_templates/notify_smtp.sh" + LatestNotifyRelease="$(curl -s -r 0-150 $RawNotifyUrl | sed -n "/NOTIFY_SMTP_VERSION/s/NOTIFY_SMTP_VERSION=//p" | tr -d '"')" + if [[ "$NOTIFY_SMTP_VERSION" != "$LatestNotifyRelease" ]] ; then + printf -v NotifyUpdate "\n\nnotify_smtp.sh update avialable:\n $NOTIFY_SMTP_VERSION -> $LatestNotifyRelease\n" + MessageBody="${MessageBody}${NotifyUpdate}" + fi + trigger_notification } diff --git a/notify_templates/notify_telegram.sh b/notify_templates/notify_telegram.sh index e8bd8df..5113f35 100644 --- a/notify_templates/notify_telegram.sh +++ b/notify_templates/notify_telegram.sh @@ -1,4 +1,5 @@ ### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. +NOTIFY_TELEGRAM_VERSION="v0.1" # # Copy/rename this file to notify.sh to enable the notification snippet. # Required receiving services must already be set up. @@ -34,10 +35,17 @@ send_notification() { ### to not send notifications when dockcheck itself has updates. dockcheck_notification() { printf "\nSending Telegram dockcheck notification\n" - + MessageTitle="$FromHost - New version of dockcheck available." # Setting the MessageBody variable here. printf -v MessageBody "$FromHost - New version of dockcheck available.\n\nInstalled version: $1 \nLatest version: $2 \n\nChangenotes: $3" - + + RawNotifyUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/notify_templates/notify_telegram.sh" + LatestNotifyRelease="$(curl -s -r 0-150 $RawNotifyUrl | sed -n "/NOTIFY_TELEGRAM_VERSION/s/NOTIFY_TELEGRAM_VERSION=//p" | tr -d '"')" + if [[ "$NOTIFY_TELEGRAM_VERSION" != "$LatestNotifyRelease" ]] ; then + printf -v NotifyUpdate "\n\nnotify_telegram.sh update avialable:\n $NOTIFY_TELEGRAM_VERSION -> $LatestNotifyRelease\n" + MessageBody="${MessageBody}${NotifyUpdate}" + fi + trigger_notification }