Ensure whiptail success/summary screen is final step before reboot

This commit is contained in:
Jason Ertel
2020-07-15 11:12:44 -04:00
parent 83428d4785
commit 3c42f50e99

View File

@@ -626,18 +626,20 @@ success=$(tail -10 $setup_log | grep Failed | awk '{ print $2}')
if [[ $success != 0 ]]; then SO_ERROR=1; fi # evaluate success first so it doesn't check against the output of so-allow if [[ $success != 0 ]]; then SO_ERROR=1; fi # evaluate success first so it doesn't check against the output of so-allow
if [[ -n $SO_ERROR ]]; then if [[ -n $SO_ERROR ]]; then
echo "Errors detected during setup; skipping post-setup steps to allow for analysis of failures." >> $setup_log 2>&1
SKIP_REBOOT=1 SKIP_REBOOT=1
whiptail_setup_failed whiptail_setup_failed
else else
whiptail_setup_complete if [[ -n $ALLOW_ROLE && -n $ALLOW_CIDR ]]; then
echo "Running so-allow -${ALLOW_ROLE} for ${ALLOW_CIDR}" >> $setup_log 2>&1
IP=$ALLOW_CIDR so-allow -$ALLOW_ROLE >> $setup_log 2>&1
fi
if [[ $THEHIVE == 1 ]]; then check_hive_init >> $setup_log 2>&1; fi if [[ $THEHIVE == 1 ]]; then check_hive_init >> $setup_log 2>&1; fi
fi
if [[ -n $ALLOW_ROLE && -n $ALLOW_CIDR ]]; then install_cleanup >> $setup_log 2>&1
echo "Running so-allow -${ALLOW_ROLE} for ${ALLOW_CIDR}"
IP=$ALLOW_CIDR so-allow -$ALLOW_ROLE >> $setup_log 2>&1
fi
install_cleanup >> $setup_log 2>&1 whiptail_setup_complete
fi
if [[ -z $SKIP_REBOOT ]]; then shutdown -r now; else exit; fi if [[ -z $SKIP_REBOOT ]]; then shutdown -r now; else exit; fi