all template rewritten, some guesswork

This commit is contained in:
mag37
2024-10-07 21:28:31 +02:00
parent e5a7a715c6
commit ac10a96cc8
10 changed files with 28 additions and 36 deletions

View File

@@ -18,8 +18,8 @@ else
fi fi
send_notification() { send_notification() {
Updates=("$@") [ -s "$ScriptWorkDir"/urls.list ] && releasenotes || Updates=("$@")
[ -s "$ScriptWorkDir"/urls.list ] && UpdToString=$( releasenotes ) || UpdToString=$( printf "%s\n" "${Updates[@]}" ) UpdToString=$( printf '%s\\n' "${Updates[@]}" )
FromHost=$(hostname) FromHost=$(hostname)
CfgFile="/usr/syno/etc/synosmtp.conf" CfgFile="/usr/syno/etc/synosmtp.conf"

View File

@@ -5,20 +5,15 @@
# Modify to fit your setup - if API, set AppriseURL to your Apprise ip/domain. # Modify to fit your setup - if API, set AppriseURL to your Apprise ip/domain.
send_notification() { send_notification() {
Updates=("$@") [ -s "$ScriptWorkDir"/urls.list ] && releasenotes || Updates=("$@")
[ -s "$ScriptWorkDir"/urls.list ] && UpdToString=$( releasenotes ) || UpdToString=$( printf "%s\n" "${Updates[@]}" ) UpdToString=$( printf '%s\\n' "${Updates[@]}" )
FromHost=$(hostname) FromHost=$(hostname)
printf "\nSending Apprise notification\n" printf "\nSending Apprise notification\n"
MessageTitle="$FromHost - updates available." MessageTitle="$FromHost - updates available."
# Setting the MessageBody variable here. # Setting the MessageBody variable here.
read -d '\n' MessageBody << __EOF MessageBody=$(printf "🐋 Containers on $FromHost with updates available: \n$UpdToString")
Containers on $FromHost with updates available:
$UpdToString
__EOF
# Modify to fit your setup: # Modify to fit your setup:
apprise -vv -t "$MessageTitle" -b "$MessageBody" \ apprise -vv -t "$MessageTitle" -b "$MessageBody" \

View File

@@ -4,11 +4,13 @@
# generic sample, the "Hello World" of notification addons # generic sample, the "Hello World" of notification addons
send_notification() { send_notification() {
Updates=("$@") [ -s "$ScriptWorkDir"/urls.list ] && releasenotes || Updates=("$@")
[ -s "$ScriptWorkDir"/urls.list ] && UpdToString=$( releasenotes ) || UpdToString=$( printf "%s\n" "${Updates[@]}" ) UpdToString=$( printf '%s\\n' "${Updates[@]}" )
FromHost=$(hostname) FromHost=$(hostname)
# platform specific notification code would go here # platform specific notification code would go here
printf "\n%bGeneric notification addon:%b" "$c_green" "$c_reset" printf "\n%bGeneric notification addon:%b" "$c_green" "$c_reset"
printf "\nThe following docker containers on %s need to be updated:\n%s\n" "$FromHost" "$UpdToString" printf "\nThe following docker containers on %s need to be updated:\n" "$FromHost"
printf "$UpdToString"
} }

View File

@@ -5,8 +5,8 @@
# Modify to fit your setup - set GotifyUrl and GotifyToken. # Modify to fit your setup - set GotifyUrl and GotifyToken.
send_notification() { send_notification() {
Updates=("$@") [ -s "$ScriptWorkDir"/urls.list ] && releasenotes || Updates=("$@")
[ -s "$ScriptWorkDir"/urls.list ] && UpdToString=$( releasenotes ) || UpdToString=$( printf "%s\n" "${Updates[@]}" ) UpdToString=$( printf '%s\\n' "${Updates[@]}" )
FromHost=$(hostname) FromHost=$(hostname)
# platform specific notification code would go here # platform specific notification code would go here
@@ -14,7 +14,7 @@ send_notification() {
# Setting the MessageTitle and MessageBody variable here. # Setting the MessageTitle and MessageBody variable here.
MessageTitle="${FromHost} - updates available." MessageTitle="${FromHost} - updates available."
MessageBody="Containers on ${FromHost} with updates available: ${UpdToString}" MessageBody=$(printf "🐋 Containers on $FromHost with updates available: \n$UpdToString")
# Modify to fit your setup: # Modify to fit your setup:
GotifyToken="Your Gotify token here" GotifyToken="Your Gotify token here"

View File

@@ -5,8 +5,8 @@
# Modify to fit your setup - set MatrixServer, Room_id and AccessToken # Modify to fit your setup - set MatrixServer, Room_id and AccessToken
send_notification() { send_notification() {
Updates=("$@") [ -s "$ScriptWorkDir"/urls.list ] && releasenotes || Updates=("$@")
[ -s "$ScriptWorkDir"/urls.list ] && UpdToString=$( releasenotes ) || UpdToString=$( printf "%s\n" "${Updates[@]}" ) UpdToString=$( printf '%s\\n' "${Updates[@]}" )
FromHost=$(hostname) FromHost=$(hostname)
# platform specific notification code would go here # platform specific notification code would go here

View File

@@ -5,20 +5,15 @@
# Use your unique Topic Name in the URL below. # Use your unique Topic Name in the URL below.
send_notification() { send_notification() {
Updates=("$@") [ -s "$ScriptWorkDir"/urls.list ] && releasenotes || Updates=("$@")
[ -s "$ScriptWorkDir"/urls.list ] && UpdToString=$( releasenotes ) || UpdToString=$( printf "%s\n" "${Updates[@]}" ) UpdToString=$( printf '%s\\n' "${Updates[@]}" )
FromHost=$(hostname) FromHost=$(hostname)
printf "\nSending ntfy.sh notification\n" printf "\nSending ntfy.sh notification\n"
MessageTitle="$FromHost - updates available." MessageTitle="$FromHost - updates available."
# Setting the MessageBody variable here. # Setting the MessageBody variable here.
read -d '\n' MessageBody << __EOF MessageBody=$(printf "🐋 Containers on $FromHost with updates available: \n$UpdToString")
Containers on $FromHost with updates available:
$UpdToString
__EOF
# Modify to fit your setup: # Modify to fit your setup:
NtfyUrl="ntfy.sh/YourUniqueTopicName" NtfyUrl="ntfy.sh/YourUniqueTopicName"

View File

@@ -6,8 +6,8 @@
# Modify to fit your setup - set Url and Token. # Modify to fit your setup - set Url and Token.
send_notification() { send_notification() {
Updates=("$@") [ -s "$ScriptWorkDir"/urls.list ] && releasenotes || Updates=("$@")
[ -s "$ScriptWorkDir"/urls.list ] && UpdToString=$( releasenotes ) || UpdToString=$( printf "%s\n" "${Updates[@]}" ) UpdToString=$( printf '%s\\n' "${Updates[@]}" )
FromHost=$(hostname) FromHost=$(hostname)
# platform specific notification code would go here # platform specific notification code would go here
@@ -15,7 +15,7 @@ printf "\nSending pushbullet notification\n"
MessageTitle="$FromHost - updates available." MessageTitle="$FromHost - updates available."
# Setting the MessageBody variable here. # Setting the MessageBody variable here.
MessageBody="Containers on $FromHost with updates available: $UpdToString" MessageBody=$(printf "🐋 Containers on $FromHost with updates available: \n$UpdToString")
# Modify to fit your setup: # Modify to fit your setup:
PushUrl="https://api.pushbullet.com/v2/pushes" PushUrl="https://api.pushbullet.com/v2/pushes"

View File

@@ -6,8 +6,8 @@
# Modify to fit your setup - set Url and Token. # Modify to fit your setup - set Url and Token.
send_notification() { send_notification() {
Updates=("$@") [ -s "$ScriptWorkDir"/urls.list ] && releasenotes || Updates=("$@")
[ -s "$ScriptWorkDir"/urls.list ] && UpdToString=$( releasenotes ) || UpdToString=$( printf "%s\n" "${Updates[@]}" ) UpdToString=$( printf '%s\\n' "${Updates[@]}" )
FromHost=$(hostname) FromHost=$(hostname)
# platform specific notification code would go here # platform specific notification code would go here
@@ -15,7 +15,7 @@ send_notification() {
MessageTitle="$FromHost - updates available." MessageTitle="$FromHost - updates available."
# Setting the MessageBody variable here. # Setting the MessageBody variable here.
MessageBody="Containers on $FromHost with updates available: $UpdToString" MessageBody=$(printf "🐋 Containers on $FromHost with updates available: \n$UpdToString")
# Modify to fit your setup: # Modify to fit your setup:
PushoverUrl="https://api.pushover.net/1/messages.json" PushoverUrl="https://api.pushover.net/1/messages.json"

View File

@@ -17,8 +17,8 @@ else
fi fi
send_notification() { send_notification() {
Updates=("$@") [ -s "$ScriptWorkDir"/urls.list ] && releasenotes || Updates=("$@")
[ -s "$ScriptWorkDir"/urls.list ] && UpdToString=$( releasenotes ) || UpdToString=$( printf "%s\n" "${Updates[@]}" ) UpdToString=$( printf '%s\\n' "${Updates[@]}" )
FromHost=$(hostname) FromHost=$(hostname)
# User variables: # User variables:

View File

@@ -5,8 +5,8 @@
# Modify to fit your setup - set TelegramChatId and TelegramToken. # Modify to fit your setup - set TelegramChatId and TelegramToken.
send_notification() { send_notification() {
Updates=("$@") [ -s "$ScriptWorkDir"/urls.list ] && releasenotes || Updates=("$@")
[ -s "$ScriptWorkDir"/urls.list ] && UpdToString=$( releasenotes ) || UpdToString=$( printf "%s\n" "${Updates[@]}" ) UpdToString=$( printf '%s\\n' "${Updates[@]}" )
FromHost=$(hostname) FromHost=$(hostname)
# platform specific notification code would go here # platform specific notification code would go here