notify.sh (985B) - raw


      1 #!/bin/sh
      2 # Gotify notify
      3 # Copyright (C) 2020 Oscar Benedito <oscar@oscarbenedito.com>
      4 #
      5 # This program is free software: you can redistribute it and/or modify
      6 # it under the terms of the GNU Affero General Public License as
      7 # published by the Free Software Foundation, either version 3 of the
      8 # License, or (at your option) any later version.
      9 #
     10 # This program is distributed in the hope that it will be useful,
     11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
     12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13 # GNU Affero General Public License for more details.
     14 #
     15 # You should have received a copy of the GNU Affero General Public License
     16 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
     17 
     18 # Notifies user using a Gotify instance.
     19 
     20 GOTIFY_DOMAIN="<redacted>"
     21 GOTIFY_TOKEN="<redacted>"
     22 
     23 curl -X POST "https://$GOTIFY_DOMAIN/message?token=$GOTIFY_TOKEN" \
     24   -F "title=$1" -F "message=$2" -F "priority=${3:-5}" \
     25   >/dev/null 2>&1