Split network init + ssh copy notices

This commit is contained in:
William Wernert
2021-04-19 14:02:00 -04:00
parent 07e0ce563d
commit ba9a45bd0f
2 changed files with 37 additions and 49 deletions

View File

@@ -203,7 +203,7 @@ if ! [[ -f $install_opt_file ]]; then
if [[ $option == "CONFIGURENETWORK" ]]; then if [[ $option == "CONFIGURENETWORK" ]]; then
collect_hostname collect_hostname
network_init_whiptail network_init_whiptail
whiptail_management_interface_setup whiptail_network_init_notice
network_init network_init
printf '%s\n' \ printf '%s\n' \
"MNIC=$MNIC" \ "MNIC=$MNIC" \
@@ -302,15 +302,8 @@ if ! [[ -f $install_opt_file ]]; then
source "$net_init_file" source "$net_init_file"
fi 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 if [[ $reinit_networking ]] || ! [[ -f $net_init_file ]]; then
whiptail_network_init_notice
network_init network_init
fi fi
@@ -323,14 +316,21 @@ if ! [[ -f $install_opt_file ]]; then
[[ -n "$so_proxy" ]] && set_proxy >> $setup_log 2>&1 [[ -n "$so_proxy" ]] && set_proxy >> $setup_log 2>&1
fi fi
if [[ $is_minion ]]; then
collect_mngr_hostname
fi
if [[ $is_minion ]]; then if [[ $is_minion ]]; then
add_mngr_ip_to_hosts add_mngr_ip_to_hosts
fi fi
if [[ $is_minion ]]; then if [[ $is_minion ]]; then
whiptail_ssh_key_copy_notice
copy_ssh_key >> $setup_log 2>&1 copy_ssh_key >> $setup_log 2>&1
fi fi
if [[ $is_minion ]] && ! (compare_versions); then if [[ $is_minion ]] && ! (compare_versions); then
info "Installer version mismatch, downloading correct version from manager" info "Installer version mismatch, downloading correct version from manager"
printf '%s\n' \ printf '%s\n' \

View File

@@ -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() { whiptail_net_method() {
[ -n "$TESTING" ] && return [ -n "$TESTING" ] && return
@@ -1098,6 +1058,20 @@ whiptail_net_setup_complete() {
exit 0 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() { whiptail_management_server() {
[ -n "$TESTING" ] && return [ -n "$TESTING" ] && return
@@ -1760,6 +1734,20 @@ whiptail_so_allow() {
whiptail_check_exitstatus $exitstatus 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() { whitpail_ssh_warning() {
[ -n "$TESTING" ] && return [ -n "$TESTING" ] && return