[fix] Replace leftover /root/install_opt strings with variable

This commit is contained in:
William Wernert
2021-01-19 11:20:48 -05:00
parent d91913e58e
commit 650008e1e6
2 changed files with 4 additions and 13 deletions

View File

@@ -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

View File

@@ -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}')