From 58bcc79c542961c2d3144865c29ddabeb92116de Mon Sep 17 00:00:00 2001 From: William Wernert Date: Thu, 10 Dec 2020 14:17:47 -0500 Subject: [PATCH] [fix] Create full dir structure, rm /root/install_opt on failure --- setup/so-functions | 5 +++-- setup/so-whiptail | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/setup/so-functions b/setup/so-functions index 890b1e8e0..aef409397 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -522,6 +522,7 @@ compare_versions() { manager_ver=$(ssh -i /root/.ssh/so.key soremote@"$MSRV" cat /etc/soversion) if [[ $manager_ver == "" ]]; then + rm /root/install_opt echo "Could not determine version of Security Onion running on manager $MSRV. Please check your network settings and run setup again." | tee -a "$setup_log" kill -SIGUSR1 "$(ps --pid $$ -oppid=)"; exit 1 fi @@ -926,16 +927,16 @@ docker_seed_registry() { } download_repo_tarball() { + mkdir -p /root/manager_setup/securityonion { local manager_ver manager_ver=$(ssh -i /root/.ssh/so.key soremote@"$MSRV" cat /etc/soversion) - mkdir -p /root/manager_setup scp -i /root/.ssh/so.key soremote@"$MSRV":/opt/so/repo/"$manager_ver".tar.gz /root/manager_setup } >> "$setup_log" 2>&1 - # Fail if the file doesn't download if ! [ -f /root/manager_setup/"$manager_ver".tar.gz ]; then + rm /root/install_opt local message="Could not download $manager_ver.tar.gz from manager, please check your network settings and verify the file /opt/so/repo/$manager_ver.tar.gz exists on the manager." echo "$message" | tee -a "$setup_log" kill -SIGUSR1 "$(ps --pid $$ -oppid=)"; exit 1 diff --git a/setup/so-whiptail b/setup/so-whiptail index a37340764..922f47b5e 100755 --- a/setup/so-whiptail +++ b/setup/so-whiptail @@ -783,6 +783,8 @@ whiptail_management_interface_setup() { else msg="initialize networking" fi + else + msg=$minion_msg fi whiptail --title "Security Onion Setup" --yesno "Setup will now $msg. Select YES to continue or NO to cancel." 8 75