From 8f7b0237695ec972f4116cafcea610b4e66e923a Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Sun, 8 Jan 2017 18:48:54 -0800 Subject: [PATCH] Shellcheck for Test for $? -eq 0 Signed-off-by: Dan Schaper --- automated install/basic-install.sh | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index e8538a18..d8006dc4 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1013,23 +1013,19 @@ update_dialogs() { UpdateCmd=$(whiptail --title "Existing Install Detected!" --menu "\n\nWe have detected an existing install.\n\nPlease choose from the following options: \n($strAdd)" ${r} ${c} 2 \ "${opt1a}" "${opt1b}" \ - "${opt2a}" "${opt2b}" 3>&2 2>&1 1>&3) + "${opt2a}" "${opt2b}" 3>&2 2>&1 1>&3) || \ + { echo "::: Cancel selected. Exiting"; exit 1; } - if [[ $? = 0 ]];then - case ${UpdateCmd} in - ${opt1a}) - echo "::: ${opt1a} option selected." - useUpdateVars=true - ;; - ${opt2a}) - echo "::: ${opt2a} option selected" - useUpdateVars=false - ;; + case ${UpdateCmd} in + ${opt1a}) + echo "::: ${opt1a} option selected." + useUpdateVars=true + ;; + ${opt2a}) + echo "::: ${opt2a} option selected" + useUpdateVars=false + ;; esac - else - echo "::: Cancel selected. Exiting..." - exit 1 - fi } main() {