notify.sh (477B) - raw


      1 #!/bin/sh
      2 # 2020 Oscar Benedito <oscar@oscarbenedito.com>
      3 # License: CC0 1.0 Universal License
      4 
      5 # Gotify notify: notifies user using a Gotify instance.
      6 
      7 GOTIFY_DOMAIN="${GOTIFY_DOMAIN:-redacted}"
      8 GOTIFY_TOKEN="${GOTIFY_TOKEN:-redacted}"
      9 
     10 curl --fail --silent --show-error \
     11   -H "X-Gotify-Key: $GOTIFY_TOKEN" \
     12   --form-string "title=${1:-}" \
     13   --form-string "message=${2:-No message.}" \
     14   --form-string "priority=${3:-5}" \
     15   "https://$GOTIFY_DOMAIN/message" \
     16   >/dev/null