[fix] Remove wazuh-agent package as well

This commit is contained in:
William Wernert
2020-11-04 16:14:58 -05:00
parent 5cb8d0beda
commit 4369b8d0f6

View File

@@ -1447,21 +1447,26 @@ reinstall_init() {
mv "$dir" "${dir}_old_${date_string}"
done < <(find /nsm -maxdepth 1 -mindepth 1 -type d -print0)
# Remove the old launcher package in case the config changes
if [ $OS = 'centos' ]; then
if rpm -qa | grep -q launcher-final; then
yum remove -y launcher-final
fi
else
if dpkg -l | grep -q launcher-final; then
apt purge -y launcher-final
fi
fi
remove_package launcher-final
remove_package wazuh-agent
} >> $setup_log 2>&1
}
remove_package() {
local package_name=$1
if [ $OS = 'centos' ]; then
if rpm -qa | grep -q "$package_name"; then
yum remove -y "$package_name"
fi
else
if dpkg -l | grep -q "$package_name"; then
apt purge -y "$package_name"
fi
fi
}
# When updating the salt version, also update the version in securityonion-builds/images/iso-task/Dockerfile and salt/salt/master.defaults.yaml and salt/salt/minion.defaults.yaml
saltify() {