ansible/roles/notifiers/files/bin/notify-gotify

22 lines
368 B
Plaintext
Raw Permalink Normal View History

2023-05-09 09:56:59 +02:00
#!/bin/sh
# shellcheck disable=SC1091
. /usr/local/etc/notifiers/gotify
PRIORITY="${PRIORITY:-5}"
if [ -n "$TITLE" ]; then
TITLE_ARG="--form title=${TITLE}"
else
TITLE_ARG=""
fi
MSG="$*"
# shellcheck disable=SC2086
curl \
"${GOTIFY_URL}/message?token=${GOTIFY_TOKEN}" \
$TITLE_ARG \
--form "message=${MSG}" \
--form "priority=${PRIORITY}"