mirror of
https://github.com/mag37/dockcheck.git
synced 2026-02-28 14:14:20 +01:00
Fix text insertion formatting for dockcheck script and container updates.
This commit is contained in:
parent
dac955544b
commit
f7e92d8a4f
1 changed files with 7 additions and 3 deletions
|
|
@ -209,12 +209,16 @@ format_output() {
|
||||||
if [[ -z "${UpdToString}" ]]; then
|
if [[ -z "${UpdToString}" ]]; then
|
||||||
FormattedOutput="None"
|
FormattedOutput="None"
|
||||||
else
|
else
|
||||||
if [[ "${UpdateType}" == "dockcheck_update" ]]; then
|
if [[ "${UpdateType}" == "container_update" ]]; then
|
||||||
|
FormattedOutput="${FormattedTextTemplate/<insert_text_cu>/${UpdToString}}"
|
||||||
|
elif [[ "${UpdateType}" == "notify_update" ]]; then
|
||||||
|
FormattedOutput="${FormattedTextTemplate/<insert_text_nu>/${UpdToString}}"
|
||||||
|
elif [[ "${UpdateType}" == "dockcheck_update" ]]; then
|
||||||
FormattedOutput="${FormattedTextTemplate/<insert_text_iv>/$4}"
|
FormattedOutput="${FormattedTextTemplate/<insert_text_iv>/$4}"
|
||||||
FormattedOutput="${FormattedTextTemplate/<insert_text_lv>/$5}"
|
FormattedOutput="${FormattedTextTemplate/<insert_text_lv>/$5}"
|
||||||
FormattedOutput="${FormattedTextTemplate/<insert_text_rn>/$6}"
|
FormattedOutput="${FormattedTextTemplate/<insert_text_rn>/$6}"
|
||||||
else
|
else
|
||||||
FormattedOutput="${FormattedTextTemplate/<insert_text>/${UpdToString}}"
|
FormattedOutput="Invalid input"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
@ -333,7 +337,7 @@ notify_update_notification() {
|
||||||
local template=$(get_channel_template "${channel}")
|
local template=$(get_channel_template "${channel}")
|
||||||
|
|
||||||
# Formats UpdToString variable per channel settings
|
# Formats UpdToString variable per channel settings
|
||||||
format_output "notify_update" "$(output_format "${channel}")" "Notify templates on $FromHost with updates available:\n<insert_text>\n"
|
format_output "notify_update" "$(output_format "${channel}")" "Notify templates on $FromHost with updates available:\n<insert_text_nu>\n"
|
||||||
|
|
||||||
# Setting the MessageBody variable here.
|
# Setting the MessageBody variable here.
|
||||||
printf -v MessageBody "${FormattedOutput}"
|
printf -v MessageBody "${FormattedOutput}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue