From 0b995533ea4fdb2f71b400e4b7200c9ba667e6f6 Mon Sep 17 00:00:00 2001 From: William Wernert Date: Tue, 7 Jul 2020 13:01:29 -0400 Subject: [PATCH] [refactor] Only notify user of error found during setup --- setup/so-setup | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/setup/so-setup b/setup/so-setup index 775064f9f..6242d4a14 100755 --- a/setup/so-setup +++ b/setup/so-setup @@ -51,21 +51,22 @@ echo "---- Starting setup at $(date -u) ----" >> $setup_log 2>&1 automated=no function progress() { + local title='Security Onion Install' if grep -q "ERROR" $setup_log || [[ -s /var/spool/mail/root ]]; then if [[ -s /var/spool/mail/root ]]; then echo '[ ERROR ] /var/spool/mail/root grew unexpectedly' >> $setup_log 2>&1 fi - if [[ $automated == no ]]; then whiptail_setup_failed; else exit 1; fi - - if [[ -z $SKIP_REBOOT ]]; then shutdown -r now; else exit 1; fi - else - if [ $automated == no ]; then - whiptail --title "Security Onion Install" --gauge 'Please wait while installing' 6 60 0 - else - cat >> $setup_log 2>&1 - fi + export SO_ERROR=1 + export SKIP_REBOOT=1 + title="Error found, please check $setup_log" fi + + if [ $automated == no ]; then + whiptail --title "$title" --gauge 'Please wait while installing...' 6 60 0 # append to text + else + cat >> $setup_log 2>&1 + fi } if [[ -f automation/$automation && $(basename $automation) == $automation ]]; then