diff --git a/setup/so-functions b/setup/so-functions index fb8b17a88..bd2c05179 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -467,15 +467,15 @@ check_requirements() { if [[ "$node_type" == 'sensor' ]]; then req_nics=2; else req_nics=1; fi if [[ "$node_type" == 'fleet' ]]; then req_mem=4; fi elif [[ "$standalone_or_dist" == 'import' ]]; then - req_mem=4 - req_cores=2 + req_mem=4 + req_cores=2 req_nics=1 fi if [[ $setup_type == 'network' ]] ; then if [[ -n $nsm_mount ]]; then if [[ "$standalone_or_dist" == 'import' ]]; then - req_storage=50 + req_storage=50 else req_storage=100 fi @@ -487,7 +487,7 @@ check_requirements() { fi else if [[ "$standalone_or_dist" == 'import' ]]; then - req_storage=50 + req_storage=50 else req_storage=200 fi @@ -498,11 +498,20 @@ check_requirements() { fi if [[ $num_nics -lt $req_nics ]]; then - whiptail_requirements_error "NICs" "$num_nics" "$req_nics" + if [[ $num_nics -eq 1 ]]; then + whiptail_requirements_error "NIC" "$num_nics" "$req_nics" + else + whiptail_requirements_error "NICs" "$num_nics" "$req_nics" + fi fi if [[ $num_cpu_cores -lt $req_cores ]]; then - whiptail_requirements_error "cores" "$num_cpu_cores" "$req_cores" + if [[ $num_cpu_cores -eq 1 ]]; then + whiptail_requirements_error "core" "$num_cpu_cores" "$req_cores" + else + whiptail_requirements_error "cores" "$num_cpu_cores" "$req_cores" + fi + fi if [[ $total_mem_hr -lt $req_mem ]]; then diff --git a/setup/so-whiptail b/setup/so-whiptail index 21e394b65..a1f07868c 100755 --- a/setup/so-whiptail +++ b/setup/so-whiptail @@ -340,11 +340,27 @@ whiptail_requirements_error() { [ -n "$TESTING" ] && return - whiptail --title "Security Onion Setup" \ - --yesno "This machine currently has $current_val $requirement_needed, but needs $needed_val to meet minimum requirements. Press YES to continue anyway, or press NO to cancel." 10 75 + if [[ $(echo "$requirement_needed" | tr '[:upper:]' '[:lower:]') == 'nics' ]]; then + whiptail --title "Security Onion Setup" \ + --msgbox "This machine currently has $current_val $requirement_needed, but needs $needed_val to meet minimum requirements. Press OK to exit setup and reconfigure the machine." 10 75 + + # Same as whiptail_cancel, but changed the wording to exit instead of cancel. + whiptail --title "Security Onion Setup" --msgbox "Exiting Setup. No changes have been made." 8 75 + if [ -d "/root/installtmp" ]; then + { + echo "/root/installtmp exists"; + install_cleanup; + echo "/root/installtmp removed"; + } >> $setup_log 2>&1 + fi + exit + else + whiptail --title "Security Onion Setup" \ + --yesno "This machine currently has $current_val $requirement_needed, but needs $needed_val to meet minimum requirements. Press YES to continue anyway, or press NO to cancel." 10 75 - local exitstatus=$? - whiptail_check_exitstatus $exitstatus + local exitstatus=$? + whiptail_check_exitstatus $exitstatus + fi } whiptail_storage_requirements() {