From 965f2dd825a772a96a5ac6efd088175d684182e2 Mon Sep 17 00:00:00 2001 From: mag37 Date: Fri, 14 Mar 2025 20:36:07 +0100 Subject: [PATCH] first change to DSM --- notify_templates/notify_DSM.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/notify_templates/notify_DSM.sh b/notify_templates/notify_DSM.sh index 7d38236..548a923 100644 --- a/notify_templates/notify_DSM.sh +++ b/notify_templates/notify_DSM.sh @@ -1,5 +1,6 @@ ### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. -# INFO: ssmtp is depcerated - consider to use msmtp instead. +NOTIFY_DSM_VERSION="v0.1" +# INFO: ssmtp is deprecated - consider to use msmtp instead. # # Copy/rename this file to notify.sh to enable the notification snipppet. # mSMTP/sSMTP has to be installed and configured manually. @@ -70,5 +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 + trigger_notification }