From afdf818fe3690bc36af9c90a98bcbb46d9395384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= <torjus@usit.uio.no> Date: Mon, 10 Jan 2022 13:51:50 +0100 Subject: [PATCH] Verify token and url is set --- entrypoint.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index fa66ff3..0eada59 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,5 +1,15 @@ #!/bin/sh -set -xe +set -e # TODO: Verify that variables are set properly +if [ -z ${PLUGIN_GOTIFY_URL} ]; then + echo "PLUGIN_GOTIFY_URL is not set"; + exit 1 +fi + +if [ -z ${PLUGIN_GOTIFY_TOKEN} ]; then + echo "PLUGIN_GOTIFY_TOKEN is not set"; + exit 1 +fi + curl "${PLUGIN_GOTIFY_URL}/message?token=${PLUGIN_GOTIFY_TOKEN}" -F "title=${PLUGIN_TITLE}" -F "message=${PLUGIN_MESSAGE}" -F "priority=5"