diff --git a/setup.sh b/setup.sh index 79f2bda..64da036 100755 --- a/setup.sh +++ b/setup.sh @@ -30,12 +30,12 @@ Supported Environments: EOF } -environment = "" -account_id = "" -api_key = "" -region = "" -cluster_name = "" -license_key = "" +environment="" +account_id="" +api_key="" +region="" +cluster_name="" +license_key="" setup_k8s () { curl -Ls https://download.newrelic.com/install/newrelic-cli/scripts/install.sh \ @@ -119,7 +119,7 @@ while [ "$#" -gt 0 ]; do show_help exit 1 else - $account_id = false + $account_id = "" fi fi ;; @@ -133,7 +133,7 @@ while [ "$#" -gt 0 ]; do show_help exit 1 else - $api_key = false + $api_key = "" fi fi ;; @@ -147,11 +147,11 @@ while [ "$#" -gt 0 ]; do show_help exit 1 else - $region = false + $region = "" fi fi ;; - -c|--cluster-name) + -n|--cluster-name) if [ "$2" ]; then cluster_name="$2" shift 2 @@ -161,7 +161,7 @@ while [ "$#" -gt 0 ]; do show_help exit 1 else - $cluster_name = false + $cluster_name = "" fi fi ;; @@ -175,7 +175,7 @@ while [ "$#" -gt 0 ]; do show_help exit 1 else - $license_key = false + $license_key = "" fi fi ;; @@ -187,8 +187,15 @@ while [ "$#" -gt 0 ]; do esac done -if ["$environment" == "k8s"]; then +if [ "$environment" = "k8s" ]; then + if [ -z "$account_id" ] || [ -z "$api_key" ] || [ -z "$region" ] || [ -z "$cluster_name" ]; then + echo "Error: Missing required options for k8s environment" + show_help + exit 1 + fi setup_k8s else - echo "$environment not supported yet." + echo "Error: $environment is not supported yet." + show_allowed_environments + exit 1 fi \ No newline at end of file