From ba9a45bd0f4e663f349ae2b857fd95ed42d4bfa8 Mon Sep 17 00:00:00 2001 From: William Wernert Date: Mon, 19 Apr 2021 14:02:00 -0400 Subject: [PATCH] Split network init + ssh copy notices --- setup/so-setup | 18 ++++++------- setup/so-whiptail | 68 +++++++++++++++++++---------------------------- 2 files changed, 37 insertions(+), 49 deletions(-) diff --git a/setup/so-setup b/setup/so-setup index 6353cb996..f75e195b8 100755 --- a/setup/so-setup +++ b/setup/so-setup @@ -203,7 +203,7 @@ if ! [[ -f $install_opt_file ]]; then if [[ $option == "CONFIGURENETWORK" ]]; then collect_hostname network_init_whiptail - whiptail_management_interface_setup + whiptail_network_init_notice network_init printf '%s\n' \ "MNIC=$MNIC" \ @@ -302,15 +302,8 @@ if ! [[ -f $install_opt_file ]]; then source "$net_init_file" fi - if [[ $is_minion ]]; then - collect_mngr_hostname - fi - - if [[ $is_minion ]] || [[ $reinit_networking ]] || [[ $is_iso ]] && ! [[ -f $net_init_file ]]; then - whiptail_management_interface_setup - fi - if [[ $reinit_networking ]] || ! [[ -f $net_init_file ]]; then + whiptail_network_init_notice network_init fi @@ -323,14 +316,21 @@ if ! [[ -f $install_opt_file ]]; then [[ -n "$so_proxy" ]] && set_proxy >> $setup_log 2>&1 fi + if [[ $is_minion ]]; then + collect_mngr_hostname + fi + if [[ $is_minion ]]; then add_mngr_ip_to_hosts fi if [[ $is_minion ]]; then + whiptail_ssh_key_copy_notice copy_ssh_key >> $setup_log 2>&1 fi + + if [[ $is_minion ]] && ! (compare_versions); then info "Installer version mismatch, downloading correct version from manager" printf '%s\n' \ diff --git a/setup/so-whiptail b/setup/so-whiptail index b5cf52a68..392d46078 100755 --- a/setup/so-whiptail +++ b/setup/so-whiptail @@ -987,46 +987,6 @@ whiptail_management_nic() { } -whiptail_management_interface_setup() { - [ -n "$TESTING" ] && return - - local minion_msg - local msg - local line_count - - if [[ $is_minion ]]; then - line_count=11 - minion_msg="copy the ssh key for soremote to the manager. This will bring you to the command line temporarily to accept the manager's ECDSA certificate and enter the password for soremote" - else - line_count=9 - minion_msg="" - fi - - if [[ $is_iso ]]; then - if [[ $minion_msg != "" ]]; then - if [[ -f $net_init_file ]]; then - msg=$minion_msg - else - msg="initialize networking and $minion_msg" - fi - else - msg="initialize networking" - fi - else - msg=$minion_msg - fi - - read -r -d '' message <<- EOM - Setup will now $msg. - - Select OK to continue. - EOM - - whiptail --title "Security Onion Setup" --msgbox "$message" $line_count 75 - local exitstatus=$? - whiptail_check_exitstatus $exitstatus -} - whiptail_net_method() { [ -n "$TESTING" ] && return @@ -1098,6 +1058,20 @@ whiptail_net_setup_complete() { exit 0 } +whiptail_network_init_notice() { + [ -n "$TESTING" ] && return + + read -r -d '' message <<- EOM + Setup will now initialize networking. + + Select OK to continue. + EOM + + whiptail --title "Security Onion Setup" --msgbox "$message" 9 75 + local exitstatus=$? + whiptail_check_exitstatus $exitstatus +} + whiptail_management_server() { [ -n "$TESTING" ] && return @@ -1760,6 +1734,20 @@ whiptail_so_allow() { whiptail_check_exitstatus $exitstatus } +whiptail_ssh_key_copy_notice() { + [ -n "$TESTING" ] && return + + read -r -d '' message <<- EOM + Setup will now copy the ssh key for soremote to the manager. This will bring you to the command line temporarily to accept the manager's ECDSA certificate and enter the password for soremote. + + Select OK to continue. + EOM + + whiptail --title "Security Onion Setup" --msgbox "$message" 11 75 + local exitstatus=$? + whiptail_check_exitstatus $exitstatus +} + whitpail_ssh_warning() { [ -n "$TESTING" ] && return