mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Change when prereq packages are installed to follow new order
This commit is contained in:
@@ -1008,26 +1008,13 @@ installer_progress_loop() {
|
|||||||
|
|
||||||
installer_prereq_packages() {
|
installer_prereq_packages() {
|
||||||
if [ "$OS" == centos ]; then
|
if [ "$OS" == centos ]; then
|
||||||
# Print message to stdout so the user knows setup is doing something
|
|
||||||
# Install bind-utils so the host command exists
|
|
||||||
if [[ ! $is_iso ]]; then
|
if [[ ! $is_iso ]]; then
|
||||||
if ! command -v host > /dev/null 2>&1; then
|
|
||||||
yum -y install bind-utils >> "$setup_log" 2>&1
|
|
||||||
fi
|
|
||||||
if ! command -v nmcli > /dev/null 2>&1; then
|
|
||||||
{
|
|
||||||
yum -y install NetworkManager
|
|
||||||
systemctl enable NetworkManager
|
|
||||||
systemctl start NetworkManager
|
|
||||||
} >> "$setup_log" 2<&1
|
|
||||||
fi
|
|
||||||
if ! yum versionlock > /dev/null 2>&1; then
|
if ! yum versionlock > /dev/null 2>&1; then
|
||||||
yum -y install yum-plugin-versionlock >> "$setup_log" 2>&1
|
yum -y install yum-plugin-versionlock >> "$setup_log" 2>&1
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
logCmd "systemctl enable NetworkManager"
|
|
||||||
logCmd "systemctl start NetworkManager"
|
|
||||||
fi
|
fi
|
||||||
|
logCmd "systemctl enable NetworkManager"
|
||||||
|
logCmd "systemctl start NetworkManager"
|
||||||
elif [ "$OS" == ubuntu ]; then
|
elif [ "$OS" == ubuntu ]; then
|
||||||
# Print message to stdout so the user knows setup is doing something
|
# Print message to stdout so the user knows setup is doing something
|
||||||
retry 50 10 "apt-get update" >> "$setup_log" 2>&1 || exit 1
|
retry 50 10 "apt-get update" >> "$setup_log" 2>&1 || exit 1
|
||||||
|
|||||||
@@ -274,23 +274,6 @@ if [[ ( $is_manager || $is_import ) && $is_iso ]]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
percentage=0
|
|
||||||
{
|
|
||||||
installer_progress_loop & # Run progress bar to 98 in ~8 minutes while waiting for package installs
|
|
||||||
progress_bg_proc=$!
|
|
||||||
installer_prereq_packages
|
|
||||||
install_success=$?
|
|
||||||
kill -9 "$progress_bg_proc"
|
|
||||||
wait "$progress_bg_proc" &> /dev/null # Kill just sends signal, redirect output of wait to catch stdout
|
|
||||||
if [[ $install_success -gt 0 ]]; then
|
|
||||||
echo "Could not install packages required for setup, exiting now." >> "$setup_log" 2>&1
|
|
||||||
kill -SIGUSR1 "$setup_proc"; exit 1
|
|
||||||
fi
|
|
||||||
set_progress_str 99 "Detecting whether setup is running in the cloud." nolog
|
|
||||||
detect_cloud
|
|
||||||
} | progress '...'
|
|
||||||
|
|
||||||
|
|
||||||
if ! [[ -f $install_opt_file ]]; then
|
if ! [[ -f $install_opt_file ]]; then
|
||||||
if [[ $is_manager && $is_sensor ]]; then
|
if [[ $is_manager && $is_sensor ]]; then
|
||||||
check_requirements "standalone"
|
check_requirements "standalone"
|
||||||
@@ -333,10 +316,6 @@ if ! [[ -f $install_opt_file ]]; then
|
|||||||
collect_proxy_details
|
collect_proxy_details
|
||||||
[[ -n "$so_proxy" ]] && set_proxy >> $setup_log 2>&1
|
[[ -n "$so_proxy" ]] && set_proxy >> $setup_log 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$TURBO" ]]; then
|
|
||||||
use_turbo_proxy
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $is_minion ]]; then
|
if [[ $is_minion ]]; then
|
||||||
add_mngr_ip_to_hosts
|
add_mngr_ip_to_hosts
|
||||||
@@ -368,6 +347,22 @@ else
|
|||||||
rm -rf $install_opt_file >> "$setup_log" 2>&1
|
rm -rf $install_opt_file >> "$setup_log" 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
percentage=0
|
||||||
|
{
|
||||||
|
installer_progress_loop & # Run progress bar to 98 in ~8 minutes while waiting for package installs
|
||||||
|
progress_bg_proc=$!
|
||||||
|
installer_prereq_packages
|
||||||
|
install_success=$?
|
||||||
|
kill -9 "$progress_bg_proc"
|
||||||
|
wait "$progress_bg_proc" &> /dev/null # Kill just sends signal, redirect output of wait to catch stdout
|
||||||
|
if [[ $install_success -gt 0 ]]; then
|
||||||
|
echo "Could not install packages required for setup, exiting now." >> "$setup_log" 2>&1
|
||||||
|
kill -SIGUSR1 "$setup_proc"; exit 1
|
||||||
|
fi
|
||||||
|
set_progress_str 99 "Detecting whether setup is running in the cloud." nolog
|
||||||
|
detect_cloud
|
||||||
|
} | progress '...'
|
||||||
|
|
||||||
short_name=$(echo "$HOSTNAME" | awk -F. '{print $1}')
|
short_name=$(echo "$HOSTNAME" | awk -F. '{print $1}')
|
||||||
|
|
||||||
MINION_ID=$(echo "${short_name}_${install_type}" | tr '[:upper:]' '[:lower:]')
|
MINION_ID=$(echo "${short_name}_${install_type}" | tr '[:upper:]' '[:lower:]')
|
||||||
|
|||||||
Reference in New Issue
Block a user