mirror of
https://github.com/mag37/dockcheck.git
synced 2026-02-14 15:28:22 +01:00
Add file notification channel (#222)
* Add file notification channel * Bypass file channel notifications for dockcheck.sh script * Implement notification channel template reuse and advanced configuration variables. * Fix text insertion formatting for dockcheck script and container updates. * Fix dockcheck.sh notification csv and text output. * Fix ntfy variable references and replace tr for uppercase conversion. * Fix ALLOWEMPTY logic, undefined snippet case, and README formatting. * Refactor notification send/skip logic. Adjust missing variable return codes. * Adjust notifications README section for clarity and readability. --------- Co-authored-by: Matthew Oleksowicz <matt@everyoneneeds.it>
This commit is contained in:
parent
37f33d7a06
commit
31a45f1d84
18 changed files with 620 additions and 267 deletions
22
notify_templates/notify_file.sh
Normal file
22
notify_templates/notify_file.sh
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
### DISCLAIMER: This is a third party addition to dockcheck - best effort testing.
|
||||
NOTIFY_FILE_VERSION="v0.1"
|
||||
#
|
||||
# Leave (or place) this file in the "notify_templates" subdirectory within the same directory as the main dockcheck.sh script.
|
||||
# If you instead wish make your own modifications, make a copy in the same directory as the main dockcheck.sh script.
|
||||
|
||||
trigger_file_notification() {
|
||||
if [[ -n "$1" ]]; then
|
||||
file_channel="$1"
|
||||
UpperChannel=$(tr '[:lower:]' '[:upper:]' <<< "$file_channel")
|
||||
else
|
||||
file_channel="file"
|
||||
UpperChannel="FILE"
|
||||
fi
|
||||
|
||||
FilePathVar="${UpperChannel}_PATH"
|
||||
|
||||
NotifyFile="${!FilePathVar:=${ScriptWorkDir}/updates_available.txt}"
|
||||
|
||||
echo "${MessageBody}" > ${NotifyFile}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue