Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wazuh central components removal is now checked #2588

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 45 additions & 8 deletions unattended_installer/install_functions/installCommon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -630,12 +630,22 @@ function installCommon_rollBack() {
common_logger "Removing Wazuh manager."
if [ "${sys_type}" == "yum" ]; then
installCommon_checkYumLock
eval "yum remove wazuh-manager -y ${debug}"
if [ "${attempt}" -ne "${max_attempts}" ]; then
eval "yum remove wazuh-manager -y ${debug}"
manager_installed=$(yum list installed 2>/dev/null | grep wazuh-manager)
fi
elif [ "${sys_type}" == "apt-get" ]; then
installCommon_checkAptLock
eval "apt-get remove --purge wazuh-manager -y ${debug}"
manager_installed=$(apt list --installed 2>/dev/null | grep wazuh-manager)
fi
common_logger "Wazuh manager removed."

if [ -n "${manager_installed}" ]; then
common_logger -w "The Wazuh manager package could not be removed."
else
common_logger "Wazuh manager removed."
fi

fi

if [[ ( -n "${wazuh_remaining_files}" || -n "${wazuh_installed}" ) && ( -n "${wazuh}" || -n "${AIO}" || -n "${uninstall}" ) ]]; then
Expand All @@ -646,12 +656,21 @@ function installCommon_rollBack() {
common_logger "Removing Wazuh indexer."
if [ "${sys_type}" == "yum" ]; then
installCommon_checkYumLock
eval "yum remove wazuh-indexer -y ${debug}"
if [ "${attempt}" -ne "${max_attempts}" ]; then
eval "yum remove wazuh-indexer -y ${debug}"
indexer_installed=$(yum list installed 2>/dev/null | grep wazuh-indexer)
fi
elif [ "${sys_type}" == "apt-get" ]; then
installCommon_checkAptLock
eval "apt-get remove --purge wazuh-indexer -y ${debug}"
indexer_installed=$(apt list --installed 2>/dev/null | grep wazuh-indexer)
fi

if [ -n "${indexer_installed}" ]; then
common_logger -w "The Wazuh indexer package could not be removed."
else
common_logger "Wazuh indexer removed."
fi
common_logger "Wazuh indexer removed."
fi

if [[ ( -n "${indexer_remaining_files}" || -n "${indexer_installed}" ) && ( -n "${indexer}" || -n "${AIO}" || -n "${uninstall}" ) ]]; then
Expand All @@ -664,12 +683,21 @@ function installCommon_rollBack() {
common_logger "Removing Filebeat."
if [ "${sys_type}" == "yum" ]; then
installCommon_checkYumLock
eval "yum remove filebeat -y ${debug}"
if [ "${attempt}" -ne "${max_attempts}" ]; then
eval "yum remove filebeat -y ${debug}"
filebeat_installed=$(yum list installed 2>/dev/null | grep filebeat)
fi
elif [ "${sys_type}" == "apt-get" ]; then
installCommon_checkAptLock
eval "apt-get remove --purge filebeat -y ${debug}"
filebeat_installed=$(apt list --installed 2>/dev/null | grep filebeat)
fi

if [ -n "${filebeat_installed}" ]; then
common_logger -w "The Filebeat package could not be removed."
else
common_logger "Filebeat removed."
fi
common_logger "Filebeat removed."
fi

if [[ ( -n "${filebeat_remaining_files}" || -n "${filebeat_installed}" ) && ( -n "${wazuh}" || -n "${AIO}" || -n "${uninstall}" ) ]]; then
Expand All @@ -682,12 +710,21 @@ function installCommon_rollBack() {
common_logger "Removing Wazuh dashboard."
if [ "${sys_type}" == "yum" ]; then
installCommon_checkYumLock
eval "yum remove wazuh-dashboard -y ${debug}"
if [ "${attempt}" -ne "${max_attempts}" ]; then
eval "yum remove wazuh-dashboard -y ${debug}"
dashboard_installed=$(yum list installed 2>/dev/null | grep wazuh-dashboard)
fi
elif [ "${sys_type}" == "apt-get" ]; then
installCommon_checkAptLock
eval "apt-get remove --purge wazuh-dashboard -y ${debug}"
dashboard_installed=$(apt list --installed 2>/dev/null | grep wazuh-dashboard)
fi

if [ -n "${dashboard_installed}" ]; then
common_logger -w "The Wazuh dashboard package could not be removed."
else
common_logger "Wazuh dashboard removed."
fi
common_logger "Wazuh dashboard removed."
fi

if [[ ( -n "${dashboard_remaining_files}" || -n "${dashboard_installed}" ) && ( -n "${dashboard}" || -n "${AIO}" || -n "${uninstall}" ) ]]; then
Expand Down