Merge pull request #9608 from Security-Onion-Solutions/kilo

setup improvements
This commit is contained in:
Jason Ertel
2023-01-20 13:11:11 -05:00
committed by GitHub
3 changed files with 16 additions and 21 deletions

View File

@@ -1943,7 +1943,7 @@ securityonion_repo() {
# if the package is updated when the update_packages function is called # if the package is updated when the update_packages function is called
logCmd "yum -v -y update centos-release" logCmd "yum -v -y update centos-release"
info "Backing up the .repo files that were added by the centos-release package." info "Backing up the .repo files that were added by the centos-release package."
logCmd "find /etc/yum.repos.d/ -type f -not -name 'securityonion*repo' -exec mv -bvf {} /root/oldrepos/ \;" logCmd "mv -bvf /etc/yum.repos.d/CentOS* /root/oldrepos/"
logCmd "yum repolist all" logCmd "yum repolist all"
fi fi
} }
@@ -2380,3 +2380,15 @@ wait_for_file() {
wait_for_salt_minion() { wait_for_salt_minion() {
retry 60 5 "journalctl -u salt-minion.service | grep 'Minion is ready to receive requests'" >> "$setup_log" 2>&1 || exit 1 retry 60 5 "journalctl -u salt-minion.service | grep 'Minion is ready to receive requests'" >> "$setup_log" 2>&1 || exit 1
} }
verify_setup() {
info "Verifying setup"
output=$(./so-verify "$setup_type" 2>&1)
result=$?
echo "$output" >> "$setup_log"
if [[ $result -eq 0 ]]; then
whiptail_setup_complete
else
whiptail_setup_failed
fi
}

View File

@@ -585,7 +585,7 @@ if ! [[ -f $install_opt_file ]]; then
fi fi
checkin_at_boot checkin_at_boot
set_initial_firewall_access set_initial_firewall_access
./so-verify $setup_type verify_setup
else else
touch /root/accept_changes touch /root/accept_changes
mkdir -p /opt/so mkdir -p /opt/so
@@ -608,10 +608,8 @@ if ! [[ -f $install_opt_file ]]; then
configure_minion "$minion_type" configure_minion "$minion_type"
drop_install_options drop_install_options
checkin_at_boot checkin_at_boot
./so-verify $setup_type verify_setup
fi fi
# Need to make sure the latest install is located on the web server of the manager to check the versions and donwload the code if required # Need to make sure the latest install is located on the web server of the manager to check the versions and donwload the code if required
fi fi

View File

@@ -9,15 +9,10 @@ cd "$(dirname "$0")" || exit 255
source ../salt/common/tools/sbin/so-common source ../salt/common/tools/sbin/so-common
source ./so-functions source ./so-functions
source ./so-whiptail
source ./so-variables source ./so-variables
setup_type=$1 setup_type=$1
setup_in_progress() {
ps -ef | grep so-setup | grep -v grep &> /dev/null
}
using_iso() { using_iso() {
if [ "$setup_type" == "iso" ]; then if [ "$setup_type" == "iso" ]; then
return 0 return 0
@@ -25,14 +20,6 @@ using_iso() {
return 0 return 0
} }
whipit() {
if [[ $exit_code -eq 0 ]]; then
whiptail_setup_complete
else
whiptail_setup_failed
fi
}
# Check entire setup log for errors or unexpected salt states # Check entire setup log for errors or unexpected salt states
log_has_errors() { log_has_errors() {
# Ignore salt mast cached public key and minion failed to auth because this is a test # Ignore salt mast cached public key and minion failed to auth because this is a test
@@ -105,8 +92,6 @@ main() {
echo "Successfully completed setup!" echo "Successfully completed setup!"
fi fi
setup_in_progress && whipit $exit_code
exit $exit_code exit $exit_code
} }