-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new option -i, inform - to send notifications.
- Loading branch information
Showing
7 changed files
with
137 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# ignore users custom notify.sh | ||
/notify.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,30 @@ | ||
### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. | ||
# Copy/rename this file to notify.sh to enable email notifications on synology DSM | ||
# | ||
# Copy/rename this file to notify.sh to enable email notifications on Synology DSM | ||
# DSM Notification Email has to be configured manually. | ||
# Modify to your liking - changing SendMailTo and Subject and content. | ||
|
||
send_notification() { | ||
Updates=("$@") | ||
UpdToString=$( printf "%s\n" "${Updates[@]}" ) | ||
# change this to your usual destination for synology DSM notification emails | ||
[email protected] | ||
FromHost=$(hostname) | ||
|
||
printf "\nSending email notification\n" | ||
# User variables: | ||
# change this to your usual destination for synology DSM notification emails | ||
SendMailTo="[email protected]" | ||
SubjectTag="diskstation" | ||
|
||
printf "\nSending email notification.\n" | ||
|
||
ssmtp $SendMailTo << __EOF | ||
From: "$FromHost" <$SendMailTo> | ||
date:$(date -R) | ||
To: <$SendMailTo> | ||
Subject: [diskstation] Some docker containers need to be updated | ||
Subject: [$SubjectTag] Updates available on $FromHost | ||
Content-Type: text/plain; charset=UTF-8; format=flowed | ||
Content-Transfer-Encoding: 7bit | ||
The following docker containers on $FromHost need to be updated: | ||
The following containers on $FromHost have updates available: | ||
$UpdToString | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. | ||
# | ||
# Copy/rename this file to notify.sh to enable the notification snippet. | ||
# Required receiving services must already be set up. | ||
# Modify to fit your setup - if API, set AppriseURL to your Apprise ip/domain. | ||
|
||
send_notification() { | ||
Updates=("$@") | ||
UpdToString=$( printf "%s\n" "${Updates[@]}" ) | ||
FromHost=$(hostname) | ||
|
||
printf "\nSending Apprise notification\n" | ||
|
||
MessageTitle="$FromHost - updates available." | ||
# Setting the MessageBody variable here. | ||
read -d '\n' MessageBody << __EOF | ||
Containers on $FromHost with updates available: | ||
$UpdToString | ||
__EOF | ||
|
||
# Modify to fit your setup: | ||
apprise -vv -t "$MessageTitle" -b "$MessageBody" \ | ||
mailto://myemail:[email protected] \ | ||
mastodons://{token}@{host} \ | ||
pbul://o.gn5kj6nfhv736I7jC3cj3QLRiyhgl98b \ | ||
tgram://{bot_token}/{chat_id}/ | ||
|
||
### If you use the Apprise-API - Comment out the apprise command above. | ||
### Uncomment the AppriseURL and the curl-line below: | ||
# AppriseURL="http://apprise.mydomain.tld:1234/notify/apprise" | ||
# curl -X POST -F "title=$MessageTitle" -F "body=$MessageBody" -F "tags=all" $AppriseURL | ||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. | ||
# | ||
# Copy/rename this file to notify.sh to enable the notification snipppet. | ||
# sSMTP has to be installed and configured manually. | ||
# Modify to fit your setup - changing SendMailFrom, SendMailTo, SubjectTag | ||
|
||
send_notification() { | ||
Updates=("$@") | ||
UpdToString=$( printf "%s\n" "${Updates[@]}" ) | ||
FromHost=$(hostname) | ||
|
||
# User variables: | ||
SendMailFrom="[email protected]" | ||
SendMailTo="[email protected]" | ||
SubjectTag="dockcheck" | ||
|
||
printf "\nSending email notification.\n" | ||
|
||
ssmtp $SendMailTo << __EOF | ||
From: "$FromHost" <$SendMailFrom> | ||
date:$(date -R) | ||
To: <$SendMailTo> | ||
Subject: [$SubjectTag] Updates available on $FromHost | ||
Content-Type: text/plain; charset=UTF-8; format=flowed | ||
Content-Transfer-Encoding: 7bit | ||
The following containers on $FromHost have updates available: | ||
$UpdToString | ||
__EOF | ||
} |