From 650008e1e6500c949e1fc8ea9428d5a0b06837e4 Mon Sep 17 00:00:00 2001 From: William Wernert Date: Tue, 19 Jan 2021 11:20:48 -0500 Subject: [PATCH] [fix] Replace leftover /root/install_opt strings with variable --- setup/so-functions | 15 +++------------ setup/so-setup | 2 +- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/setup/so-functions b/setup/so-functions index c462280ab..1fe45445d 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -828,8 +828,8 @@ check_requirements() { compare_versions() { manager_ver=$($sshcmd -i /root/.ssh/so.key soremote@"$MSRV" cat /etc/soversion) - if [[ $manager_ver == "" ]]; then - rm /root/install_opt + if [[ $manager_ver == '' ]]; then + rm -rf $install_opt_file 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 @@ -1203,20 +1203,11 @@ download_repo_tarball() { local manager_ver manager_ver=$($sshcmd -i /root/.ssh/so.key soremote@"$MSRV" cat /etc/soversion) >> "$setup_log" 2>&1 - - # Fail if we can't determine the version - if [[ $manager_ver == '' ]]; then - rm /root/install_opt - local message="Could not determine the version of Security Onion running on the manager, please check your network settings." - echo "$message" | tee -a "$setup_log" - kill -SIGUSR1 "$(ps --pid $$ -oppid=)"; exit - fi - $scpcmd -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 + rm -rf $install_opt_file 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-setup b/setup/so-setup index 021fd72ff..0da0b9f8d 100755 --- a/setup/so-setup +++ b/setup/so-setup @@ -318,7 +318,7 @@ if ! [[ -f $install_opt_file ]]; then fi else - rm -rf /root/install_opt >> "$setup_log" 2>&1 + rm -rf $install_opt_file >> "$setup_log" 2>&1 fi short_name=$(echo "$HOSTNAME" | awk -F. '{print $1}')