mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
[fix] Remove sudo from version check, only remove known_hosts entry if exists
This commit is contained in:
@@ -519,7 +519,7 @@ check_requirements() {
|
||||
}
|
||||
|
||||
compare_versions() {
|
||||
manager_ver=$(ssh -i /root/.ssh/so.key soremote@"$MSRV" sudo cat /etc/soversion)
|
||||
manager_ver=$(ssh -i /root/.ssh/so.key soremote@"$MSRV" cat /etc/soversion)
|
||||
|
||||
[[ "$manager_ver" == "$SOVERSION" ]]
|
||||
return
|
||||
@@ -660,7 +660,7 @@ copy_ssh_key() {
|
||||
chown -R "$SUDO_USER":"$SUDO_USER" /root/.ssh
|
||||
|
||||
echo "Removing old entry for manager from known_hosts if it exists"
|
||||
sed -i "/${MSRV}/d" /root/.ssh/known_hosts
|
||||
grep -q "$MSRV" /root/.ssh/known_hosts && sed -i "/${MSRV}/d" /root/.ssh/known_hosts
|
||||
|
||||
echo "Copying the SSH key to the manager"
|
||||
#Copy the key over to the manager
|
||||
@@ -921,7 +921,7 @@ docker_seed_registry() {
|
||||
}
|
||||
|
||||
download_repo_tarball() {
|
||||
manager_ver=$(ssh -i /root/.ssh/so.key soremote@"$MSRV" sudo cat /etc/soversion)
|
||||
manager_ver=$(ssh -i /root/.ssh/so.key soremote@"$MSRV" cat /etc/soversion)
|
||||
scp -i /root/.ssh/so.key soremote@"$MSRV":/opt/so/repo/"$manager_ver".tar.gz /root/manager_setup
|
||||
|
||||
# Fail if the file doesn't download
|
||||
|
||||
Reference in New Issue
Block a user