Skip to content

Instantly share code, notes, and snippets.

@senz
Last active November 9, 2024 20:17
Show Gist options
  • Save senz/8116a2a42770500ced514853054970b2 to your computer and use it in GitHub Desktop.
Save senz/8116a2a42770500ced514853054970b2 to your computer and use it in GitHub Desktop.
Gotify integration for OpenMediaVault notifications
#!/bin/sh
## To setup (under root):
## omv-env set -- OMV_GOTIFY_ENDPOINT <VALUE>
## omv-env set -- OMV_GOTIFY_TOKEN <VALUE>
## and put file to: /usr/share/openmediavault/notification/sink.d/98gotify
## chmod +x /usr/share/openmediavault/notification/sink.d/98gotify
## see https://docs.openmediavault.org/en/stable/various/advset.html
set -e
. /etc/default/openmediavault
. /usr/share/openmediavault/scripts/helper-functions
omv_checkyesno "${OMV_DEBUG_SCRIPT}" && exit 0
input=$1
from=$2
shift 2
recipient=$@
curl "${OMV_GOTIFY_ENDPOINT}/message?token=${OMV_GOTIFY_TOKEN}" -F "message=$(cat $input)" -F "title
=${OMV_NOTIFICATION_SUBJECT}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment