mirror of
https://github.com/mag37/dockcheck.git
synced 2026-04-19 02:47:45 +00:00
all template rewritten, some guesswork
This commit is contained in:
@@ -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"
|
||||||
|
|
||||||
|
|||||||
@@ -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" \
|
||||||
|
|||||||
@@ -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"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user