From 587874b38358faf36450ed43ab0d61da8d5a376f Mon Sep 17 00:00:00 2001 From: Marcel Stangenberger Date: Wed, 23 Jul 2025 15:17:33 +0200 Subject: [PATCH] fixed error handling, fixed parameter handling --- deploy.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/deploy.sh b/deploy.sh index cf44650..bf184a6 100644 --- a/deploy.sh +++ b/deploy.sh @@ -12,21 +12,26 @@ Fail() { } Exec() { + if [[ -z $2 ]] { + then + echo -e "${RED}application not specified, failing${NOCOL}" + exit 1 + } case $1 in install) - echo -e "${GREEN}Starting installation of $1${NOCOL}" + echo -e "${GREEN}Starting installation of $2${NOCOL}" sleep 2 - bash -c "$(curl -fsSL $CODE/$1/install.sh)" + bash -c "$(curl -fsSL $CODE/$2/install.sh)" exit 0;; setup) echo -n "Git username: " read USER echo -n "Git password: " read -s PASS - echo -e "${GREEN}Starting setup of $1${NOCOL}" + echo -e "${GREEN}Starting setup of $2${NOCOL}" sleep 2 - curl -u $USER:$PASS -so /tmp/$1.tmp $SECRET/$1/setup.env - bash -c "$(curl -fsSL $CODE/$1/setup.sh)" + curl -u $USER:$PASS -so /tmp/$2.tmp $SECRET/$2/setup.env + bash -c "$(curl -fsSL $CODE/$2/setup.sh)" rm -f /tmp/$1.tmp exit 0;; *)