From d7d4d47814f2f62112918bfa3df3c9fa2d117de8 Mon Sep 17 00:00:00 2001 From: dece Date: Wed, 1 Jun 2022 10:34:28 +0200 Subject: [PATCH] upload-text: check for required env vars --- upload-text.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/upload-text.sh b/upload-text.sh index 9d8c517..d03595e 100755 --- a/upload-text.sh +++ b/upload-text.sh @@ -20,6 +20,12 @@ usage() { CONFIG_PATH="$HOME/.config/upload-text.conf" [ -f "$CONFIG_PATH" ] && . "$CONFIG_PATH" +# Check for our environment variables. +if [ ! -v REMOTE_DEST ] || [ ! -v REMOTE_WWW ] || [ ! -v REMOTE_URL ]; then + echo "You need to provide all the required environment variables." + exit +fi + # Generate a simple HTML page from the content. BASENAME="$(basename "$1")" HTML_FILE="$(mktemp)"