From 3f56af0c8a69337e9a0b500e1b3032e3311cfa78 Mon Sep 17 00:00:00 2001 From: mag37 Date: Wed, 3 Jan 2024 10:57:00 +0100 Subject: [PATCH] Update notify_generic.sh Set the passed in array to a variable. Made a printable string with newlines. Edited formatting some. --- notify_generic.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/notify_generic.sh b/notify_generic.sh index 3276334..2ef1d98 100644 --- a/notify_generic.sh +++ b/notify_generic.sh @@ -2,11 +2,11 @@ # generic sample, the "Hello World" of notification addons send_notification() { + Updates=("$@") + UpdToString=$( printf "%s\n" "${Updates[@]}" ) + FromHost=$(hostname) -FromHost=$(hostname) - -# platform specific notification code would go here -printf "\n%bGeneric notification addon:%b" "$c_green" "$c_reset" -printf "\nThe following docker packages on $FromHost need to be updated:\n$@\n" - -} \ No newline at end of file + # platform specific notification code would go here + printf "\n%bGeneric notification addon:%b" "$c_green" "$c_reset" + printf "\nThe following docker packages on %s need to be updated:\n%s\n" "$FromHost" "$UpdToString" +}