mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-22 00:43:09 +01:00
[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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user