From 18947a462de42a1732308f005bc903d57dd581c3 Mon Sep 17 00:00:00 2001 From: mag37 Date: Sat, 20 Jan 2024 10:33:32 +0100 Subject: [PATCH 1/3] Added pushbullet template. Suggested and contributed by [@arpanghosh8453](https://github.com/arpanghosh8453) --- README.md | 2 ++ notify_pushbullet.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 notify_pushbullet.sh diff --git a/README.md b/README.md index 2e50e7d..45d8329 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,8 @@ Current templates: - Apprise (with it's [multitude](https://github.com/caronc/apprise#supported-notifications) of notifications) - both native [caronc/apprise](https://github.com/caronc/apprise) and the standalone [linuxserver/docker-apprise-api](https://github.com/linuxserver/docker-apprise-api) - Read the [QuickStart](extras/apprise_quickstart.md) +- [ntfy.sh](https://ntfy.sh/) - HTTP-based pub-sub notifications. +- [Pushbullet](https://www.pushbullet.com/) - connecting different devices with cross-platform features. Further additions are welcome - suggestions or PR! Initiated and first contributed by [yoyoma2](https://github.com/yoyoma2). diff --git a/notify_pushbullet.sh b/notify_pushbullet.sh new file mode 100644 index 0000000..9019017 --- /dev/null +++ b/notify_pushbullet.sh @@ -0,0 +1,27 @@ +### 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. +# Requires jq installed and in PATH. +# Modify to fit your setup - set Url and Token. + +send_notification() { +Updates=("$@") +UpdToString=$( printf "%s\n" "${Updates[@]}" ) +FromHost=$(hostname) + +# platform specific notification code would go here +printf "\nSending pushbullet notification\n" + +MessageTitle="$FromHost - updates available." +# Setting the MessageBody variable here. +MessageBody="Containers on $FromHost with updates available: $UpdToString" + +# Modify to fit your setup: +PushUrl="https://api.pushbullet.com/v2/pushes" +PushToken="Your Pushbullet token here" + +# Requires jq to process json data +jq -n --arg title "$MessageTitle" --arg body "$MessageBody" '{body: $body, title: $title, type: "note"}' | curl -sS -o /dev/null --show-error --fail -X POST -H "Access-Token: $PushToken" -H "Content-type: application/json" $PushUrl -d @- + +} From 722fb90ce292197fe2ef6da01db1cc96316d19bd Mon Sep 17 00:00:00 2001 From: mag37 Date: Sat, 20 Jan 2024 10:36:41 +0100 Subject: [PATCH 2/3] pushbullet info --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 45d8329..31bfef3 100644 --- a/README.md +++ b/README.md @@ -17,12 +17,12 @@ ___ ## :bell: Changelog +- **v0.3.6**: Added pushbullet template. - **v0.3.5**: Added a simple progress bar for the registry checkup. - **v0.3.4**: Added ntfy.sh template and error message on registry fail. - **v0.3.3**: Added Apprise template and the option `-i` inform - to send notifications. - **v0.3.2**: Added a notify function to wrap a notify-script, currently DSM/Ssmtp + template script. - **v0.3.1**: Addded option `-m` , monochrome mode - no printf color codes. -- **v0.3.0**: Added option `-d N`, age (days) new images have to be before being pulled and updated. ___ ## :nut_and_bolt: Dependencies From ae53fe2cc7b57278a125d0cd02b1ea2de5a7b835 Mon Sep 17 00:00:00 2001 From: mag37 Date: Sat, 20 Jan 2024 10:38:11 +0100 Subject: [PATCH 3/3] pushbullet template version bump. --- dockcheck.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dockcheck.sh b/dockcheck.sh index be30773..4abfb63 100755 --- a/dockcheck.sh +++ b/dockcheck.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -VERSION="v0.3.5" -### ChangeNotes: Added a simple handcrafted progress bar. +VERSION="v0.3.6" +### ChangeNotes: Added a Pushbullet template. Github="https://github.com/mag37/dockcheck" RawUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/dockcheck.sh"