From d85767bdb1cfa2b7a0960946a24237eba9c13dd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Mon, 10 Jan 2022 15:05:05 +0100 Subject: [PATCH] Update entrypoint --- entrypoint.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 0eada59..e8c7fad 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,5 +1,4 @@ #!/bin/sh -set -e # TODO: Verify that variables are set properly if [ -z ${PLUGIN_GOTIFY_URL} ]; then @@ -12,4 +11,11 @@ if [ -z ${PLUGIN_GOTIFY_TOKEN} ]; then exit 1 fi -curl "${PLUGIN_GOTIFY_URL}/message?token=${PLUGIN_GOTIFY_TOKEN}" -F "title=${PLUGIN_TITLE}" -F "message=${PLUGIN_MESSAGE}" -F "priority=5" +res=$(curl -s "${PLUGIN_GOTIFY_URL}/message?token=${PLUGIN_GOTIFY_TOKEN}" -F "title=${PLUGIN_TITLE}" -F "message=${PLUGIN_MESSAGE}" -F "priority=5") +if [ "$?" -ne "0" ]; then + echo "Failed to send message" + exit "$?" +fi + +echo "Sent message with title ${PLUGIN_TITLE}:" +echo "${PLUGIN_MESSAGE}" \ No newline at end of file