From f7e92d8a4f0810cfd29a801e17633841222186da Mon Sep 17 00:00:00 2001 From: Matthew Oleksowicz Date: Thu, 21 Aug 2025 21:19:02 -0400 Subject: [PATCH] Fix text insertion formatting for dockcheck script and container updates. --- notify_templates/notify_v2.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/notify_templates/notify_v2.sh b/notify_templates/notify_v2.sh index 436e312..79ab6a4 100644 --- a/notify_templates/notify_v2.sh +++ b/notify_templates/notify_v2.sh @@ -209,12 +209,16 @@ format_output() { if [[ -z "${UpdToString}" ]]; then FormattedOutput="None" else - if [[ "${UpdateType}" == "dockcheck_update" ]]; then + if [[ "${UpdateType}" == "container_update" ]]; then + FormattedOutput="${FormattedTextTemplate//${UpdToString}}" + elif [[ "${UpdateType}" == "notify_update" ]]; then + FormattedOutput="${FormattedTextTemplate//${UpdToString}}" + elif [[ "${UpdateType}" == "dockcheck_update" ]]; then FormattedOutput="${FormattedTextTemplate//$4}" FormattedOutput="${FormattedTextTemplate//$5}" FormattedOutput="${FormattedTextTemplate//$6}" else - FormattedOutput="${FormattedTextTemplate//${UpdToString}}" + FormattedOutput="Invalid input" fi fi fi @@ -333,7 +337,7 @@ notify_update_notification() { local template=$(get_channel_template "${channel}") # Formats UpdToString variable per channel settings - format_output "notify_update" "$(output_format "${channel}")" "Notify templates on $FromHost with updates available:\n\n" + format_output "notify_update" "$(output_format "${channel}")" "Notify templates on $FromHost with updates available:\n\n" # Setting the MessageBody variable here. printf -v MessageBody "${FormattedOutput}"