-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from yoyoma2/main
add a generic sample notification and a DSM notification addon
- Loading branch information
Showing
3 changed files
with
45 additions
and
0 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
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,29 @@ | ||
### 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 | ||
# 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 | ||
SendMailTo=me@mydomain.com | ||
FromHost=$(hostname) | ||
|
||
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 | ||
Content-Type: text/plain; charset=UTF-8; format=flowed | ||
Content-Transfer-Encoding: 7bit | ||
The following docker containers on $FromHost need to be updated: | ||
$UpdToString | ||
From $FromHost | ||
__EOF | ||
} |
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,13 @@ | ||
### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. | ||
# Copy/rename this file to notify.sh to enable email/text notifications | ||
# generic sample, the "Hello World" of notification addons | ||
|
||
send_notification() { | ||
Updates=("$@") | ||
UpdToString=$( printf "%s\n" "${Updates[@]}" ) | ||
FromHost=$(hostname) | ||
|
||
# platform specific notification code would go here | ||
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" | ||
} |