diff --git a/dockcheck.sh b/dockcheck.sh index 83a5998..dda9efc 100755 --- a/dockcheck.sh +++ b/dockcheck.sh @@ -152,7 +152,7 @@ releasenotes() { for update in ${GotUpdates[@]}; do found=false while read -r container url; do - [[ $update == $container ]] && Updates+=("$update -> $url") && found=true + [[ $update == $container ]] && Updates+=("$update -> $url") && found=true done < "$ScriptWorkDir"/urls.list [[ $found == false ]] && Updates+=("$update -> url missing") || continue done diff --git a/notify_templates/notify_DSM.sh b/notify_templates/notify_DSM.sh index 4285481..d9a0cd9 100644 --- a/notify_templates/notify_DSM.sh +++ b/notify_templates/notify_DSM.sh @@ -36,6 +36,8 @@ SenderMail=${SenderMail:-$(grep 'eventmail1' $CfgFile | sed -n 's/.*"\([^"]*\)". printf "\nSending email notification.\n" +printf -v MessageBody "🐋 Containers on $FromHost with updates available:\n\n$UpdToString" + $MailPkg $SendMailTo << __EOF From: "$SenderName" <$SenderMail> date:$(date -R) @@ -44,10 +46,7 @@ Subject: $SubjectTag Updates available on $FromHost Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit -The following containers on $FromHost have updates available: - -$UpdToString - +$MessageBody From $SenderName __EOF } diff --git a/notify_templates/notify_apprise.sh b/notify_templates/notify_apprise.sh index 74a6cb5..8663d43 100644 --- a/notify_templates/notify_apprise.sh +++ b/notify_templates/notify_apprise.sh @@ -13,7 +13,7 @@ printf "\nSending Apprise notification\n" MessageTitle="$FromHost - updates available." # Setting the MessageBody variable here. -MessageBody=$(printf "🐋 Containers on $FromHost with updates available: \n$UpdToString") +printf -v MessageBody "🐋 Containers on $FromHost with updates available:\n$UpdToString" # Modify to fit your setup: apprise -vv -t "$MessageTitle" -b "$MessageBody" \ diff --git a/notify_templates/notify_gotify.sh b/notify_templates/notify_gotify.sh index 0b22cbc..b88f597 100644 --- a/notify_templates/notify_gotify.sh +++ b/notify_templates/notify_gotify.sh @@ -14,7 +14,7 @@ send_notification() { # Setting the MessageTitle and MessageBody variable here. MessageTitle="${FromHost} - updates available." - MessageBody=$(printf "🐋 Containers on $FromHost with updates available: \n$UpdToString") + printf -v MessageBody "🐋 Containers on $FromHost with updates available:\n$UpdToString" # Modify to fit your setup: GotifyToken="Your Gotify token here" diff --git a/notify_templates/notify_ntfy-sh.sh b/notify_templates/notify_ntfy-sh.sh index 7126c63..867dcaa 100644 --- a/notify_templates/notify_ntfy-sh.sh +++ b/notify_templates/notify_ntfy-sh.sh @@ -13,7 +13,7 @@ printf "\nSending ntfy.sh notification\n" MessageTitle="$FromHost - updates available." # Setting the MessageBody variable here. -MessageBody=$(printf "🐋 Containers on $FromHost with updates available: \n$UpdToString") +printf -v MessageBody "🐋 Containers on $FromHost with updates available:\n$UpdToString" # Modify to fit your setup: NtfyUrl="ntfy.sh/YourUniqueTopicName" diff --git a/notify_templates/notify_pushbullet.sh b/notify_templates/notify_pushbullet.sh index 3f181a2..a07b604 100644 --- a/notify_templates/notify_pushbullet.sh +++ b/notify_templates/notify_pushbullet.sh @@ -15,7 +15,7 @@ printf "\nSending pushbullet notification\n" MessageTitle="$FromHost - updates available." # Setting the MessageBody variable here. -MessageBody=$(printf "🐋 Containers on $FromHost with updates available: \n$UpdToString") +printf -v MessageBody "🐋 Containers on $FromHost with updates available:\n$UpdToString" # Modify to fit your setup: PushUrl="https://api.pushbullet.com/v2/pushes" diff --git a/notify_templates/notify_pushover.sh b/notify_templates/notify_pushover.sh index 15a491a..51cf036 100644 --- a/notify_templates/notify_pushover.sh +++ b/notify_templates/notify_pushover.sh @@ -15,7 +15,7 @@ send_notification() { MessageTitle="$FromHost - updates available." # Setting the MessageBody variable here. - MessageBody=$(printf "🐋 Containers on $FromHost with updates available: \n$UpdToString") + printf -v MessageBody "🐋 Containers on $FromHost with updates available:\n$UpdToString" # Modify to fit your setup: PushoverUrl="https://api.pushover.net/1/messages.json" diff --git a/notify_templates/notify_smtp.sh b/notify_templates/notify_smtp.sh index d8f188f..4d98afd 100644 --- a/notify_templates/notify_smtp.sh +++ b/notify_templates/notify_smtp.sh @@ -28,6 +28,8 @@ SubjectTag="dockcheck" printf "\nSending email notification.\n" +printf -v MessageBody "🐋 Containers on $FromHost with updates available:\n\n$UpdToString" + $MailPkg $SendMailTo << __EOF From: "$FromHost" <$SendMailFrom> date:$(date -R) @@ -36,9 +38,7 @@ Subject: [$SubjectTag] Updates available on $FromHost Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit -The following containers on $FromHost have updates available: - -$UpdToString +$MessageBody __EOF }