Skip to content

Instantly share code, notes, and snippets.

@karmanyaahm
Created November 9, 2020 06:30
Show Gist options
  • Save karmanyaahm/02bfb452b8e78a373b53bb78df5334a3 to your computer and use it in GitHub Desktop.
Save karmanyaahm/02bfb452b8e78a373b53bb78df5334a3 to your computer and use it in GitHub Desktop.
Nvchecker gotify notifications cron
#!/bin/bash
# Note: an empty json file at old_ver.json should exist before running this
cd "$(dirname "$0")"
nvchecker -l error -c nvchecker.toml
VAR="`nvcmp -c nvchecker.toml`"
url="https://gotify.example.com"
token="A123ABC.DEF"
if [ -z "$VAR" ]
then
curl "$url/message?token=$token" -F "title=no nvchecker updates" -F "message=no nvchecker updates" -F "priority=1"
else
curl "$url/message?token=$token" -F "title=nvchecker has updates" -F "message=$VAR" -F "priority=6"
fi
\cp -f new_ver.json old_ver.json
[__config__]
oldver = "old_ver.json"
newver = "new_ver.json"
[hyperspace]
source = "github"
github="hyperspacedev/hyperspace"
use_latest_release=true
[gotify-dunst]
source="github"
github="ztpnk/gotify-dunst"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment