From 3815f7e58eaf27630203513fe94adab2c4a93391 Mon Sep 17 00:00:00 2001 From: William Wernert Date: Tue, 7 Jul 2020 13:12:46 -0400 Subject: [PATCH] [refactor] Edit logic around setup failure/completion * Always run `install_cleanup` and `so-allow` * Change if statement to check whether `$success != 0` or if `$SO_ERROR` was set * Set `$IP` only for `so-allow` instead of exporting it --- setup/so-setup | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/setup/so-setup b/setup/so-setup index 37004e9e6..ede21760e 100755 --- a/setup/so-setup +++ b/setup/so-setup @@ -615,24 +615,17 @@ fi } | progress success=$(tail -10 $setup_log | grep Failed | awk '{ print $2}') -if [[ "$success" = 0 ]]; then - whiptail_setup_complete - if [[ -n $ALLOW_ROLE && -n $ALLOW_CIDR ]]; then - export IP=$ALLOW_CIDR - so-allow -$ALLOW_ROLE >> $setup_log 2>&1 - fi - - if [[ $THEHIVE == 1 ]]; then - check_hive_init - fi -else - whiptail_setup_failed +if [[ -n $ALLOW_ROLE && -n $ALLOW_CIDR ]]; then + IP=$ALLOW_CIDR so-allow -$ALLOW_ROLE >> $setup_log 2>&1 fi -if [[ -z $SKIP_REBOOT ]]; then - shutdown -r now +if [[ $success != 0 || -z $SO_ERROR ]]; then whiptail_setup_failed +else + whiptail_setup_complete + if [[ $THEHIVE == 1 ]]; then check_hive_init; fi fi install_cleanup >> $setup_log 2>&1 +if [[ -z $SKIP_REBOOT ]]; then shutdown -r now; else exit; fi