Skip to content

Commit

Permalink
Fix logger for uninstallmanager case.
Browse files Browse the repository at this point in the history
  • Loading branch information
myu1d157h0u54nd committed Feb 8, 2022
1 parent 6654ab1 commit d29d1ad
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions unattended_installer/install_functions/opendistro/wazuh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ function uninstallmanager() {

logger "Wazuh and Filebeat will be uninstalled."

# Remove packages
# Remove Wazuh
logger -w "Removing Wazuh manager."
if [[ -n "${wazuhinstalled}" ]];then
logger -w "Removing Wazuh manager."

if [ "${sys_type}" == "yum" ]; then
eval "yum remove wazuh-manager -y ${debug} &"
wait
Expand All @@ -83,8 +84,16 @@ function uninstallmanager() {
fi
fi

until [ -z "${wazuh_remaining_files}" ]
do
eval "rm -rf /var/ossec/ ${debug}"
checkWazuhRemainingFiles
done

# Remove Filebeat
logger -w "Removing Filebeat."
if [[ -n "${filebeatinstalled}" ]]; then
logger -w "Removing Filebeat."

if [ "${sys_type}" == "yum" ]; then
eval "yum remove filebeat -y ${debug} &"
wait
Expand All @@ -97,17 +106,8 @@ function uninstallmanager() {
fi
fi

# Remove files
until [ -z "${wazuh_remaining_files}" ]
do
logger -w "Removing Wazuh files."
eval "rm -rf /var/ossec/ ${debug}"
checkWazuhRemainingFiles
done

until [ -z "${filebeat_remaining_files}" ]
do
logger -w "Removing Filebeat files."
elements_to_remove=( "/var/log/filebeat/"
"/etc/systemd/system/multi-user.target.wants/wazuh-manager.service"
"/etc/systemd/system/multi-user.target.wants/filebeat.service"
Expand Down

0 comments on commit d29d1ad

Please sign in to comment.