diff --git a/setup/so-functions b/setup/so-functions index d9c9bc2b2..a046b49ca 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -1943,7 +1943,7 @@ securityonion_repo() { # if the package is updated when the update_packages function is called logCmd "yum -v -y update centos-release" 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" fi } @@ -2380,3 +2380,15 @@ wait_for_file() { 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 } + +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 +} \ No newline at end of file diff --git a/setup/so-setup b/setup/so-setup index fb19a9120..2b0abedc8 100755 --- a/setup/so-setup +++ b/setup/so-setup @@ -585,7 +585,7 @@ if ! [[ -f $install_opt_file ]]; then fi checkin_at_boot set_initial_firewall_access - ./so-verify $setup_type + verify_setup else touch /root/accept_changes mkdir -p /opt/so @@ -608,10 +608,8 @@ if ! [[ -f $install_opt_file ]]; then configure_minion "$minion_type" drop_install_options checkin_at_boot - ./so-verify $setup_type + verify_setup 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 - - fi diff --git a/setup/so-verify b/setup/so-verify index 234ef2dec..685e50d81 100755 --- a/setup/so-verify +++ b/setup/so-verify @@ -9,15 +9,10 @@ cd "$(dirname "$0")" || exit 255 source ../salt/common/tools/sbin/so-common source ./so-functions -source ./so-whiptail source ./so-variables setup_type=$1 -setup_in_progress() { - ps -ef | grep so-setup | grep -v grep &> /dev/null -} - using_iso() { if [ "$setup_type" == "iso" ]; then return 0 @@ -25,14 +20,6 @@ using_iso() { 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 log_has_errors() { # Ignore salt mast cached public key and minion failed to auth because this is a test @@ -44,7 +31,7 @@ log_has_errors() { # Ignore Failed: 0 since that is the salt state output, and we detect state failures # via Result: False already. - + grep -E "FAILED|Failed|failed|ERROR|Error|Result: False" "$setup_log" | \ grep -vE "The Salt Master has cached the public key for this node" | \ grep -vE "Minion failed to authenticate with the master" | \ @@ -105,8 +92,6 @@ main() { echo "Successfully completed setup!" fi - setup_in_progress && whipit $exit_code - exit $exit_code }