mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
[fix] Reboot on early failure too, better if statements
This commit is contained in:
@@ -51,18 +51,17 @@ echo "---- Starting setup at $(date -u) ----" >> $setup_log 2>&1
|
|||||||
|
|
||||||
automated=no
|
automated=no
|
||||||
function progress() {
|
function progress() {
|
||||||
if [ $automated == no ]; then
|
if grep -q "ERROR" $setup_log || [[ -s /var/spool/mail/root ]]; then
|
||||||
if grep -q "ERROR" $setup_log || [[ -s /var/spool/mail/root ]]; then
|
if [[ $automated == no ]]; then whiptail_setup_failed; else exit 1; fi
|
||||||
whiptail_setup_failed
|
|
||||||
fi
|
if [[ -z $SKIP_REBOOT ]]; then shutdown -r now; fi
|
||||||
whiptail --title "Security Onion Install" --gauge 'Please wait while installing' 6 60 0
|
|
||||||
else
|
else
|
||||||
if grep -q "ERROR" $setup_log || [[ -s /var/spool/mail/root ]]; then
|
if [ $automated == no ]; then
|
||||||
exit 1
|
whiptail --title "Security Onion Install" --gauge 'Please wait while installing' 6 60 0
|
||||||
|
else
|
||||||
|
cat >> $setup_log 2>&1
|
||||||
fi
|
fi
|
||||||
cat >> $setup_log 2>&1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ -f automation/$automation && $(basename $automation) == $automation ]]; then
|
if [[ -f automation/$automation && $(basename $automation) == $automation ]]; then
|
||||||
@@ -368,10 +367,10 @@ fi
|
|||||||
# Set initial percentage to 0
|
# Set initial percentage to 0
|
||||||
export percentage=0
|
export percentage=0
|
||||||
|
|
||||||
if [[ $is_minion ]]; then
|
if [[ $is_minion ]]; then
|
||||||
set_progress_str 1 'Configuring firewall'
|
set_progress_str 1 'Configuring firewall'
|
||||||
set_initial_firewall_policy >> $setup_log 2>&1
|
set_initial_firewall_policy >> $setup_log 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set_progress_str 2 'Updating packages'
|
set_progress_str 2 'Updating packages'
|
||||||
update_packages >> $setup_log 2>&1
|
update_packages >> $setup_log 2>&1
|
||||||
@@ -599,10 +598,12 @@ fi
|
|||||||
success=$(tail -10 $setup_log | grep Failed | awk '{ print $2}')
|
success=$(tail -10 $setup_log | grep Failed | awk '{ print $2}')
|
||||||
if [[ "$success" = 0 ]]; then
|
if [[ "$success" = 0 ]]; then
|
||||||
whiptail_setup_complete
|
whiptail_setup_complete
|
||||||
|
|
||||||
if [[ -n $ALLOW_ROLE && -n $ALLOW_CIDR ]]; then
|
if [[ -n $ALLOW_ROLE && -n $ALLOW_CIDR ]]; then
|
||||||
export IP=$ALLOW_CIDR
|
export IP=$ALLOW_CIDR
|
||||||
so-allow -$ALLOW_ROLE >> $setup_log 2>&1
|
so-allow -$ALLOW_ROLE >> $setup_log 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $THEHIVE == 1 ]]; then
|
if [[ $THEHIVE == 1 ]]; then
|
||||||
check_hive_init
|
check_hive_init
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user