diff --git a/debs/SPECS/wazuh-manager/debian/postinst b/debs/SPECS/wazuh-manager/debian/postinst index 916dcc5445..4fdc981c93 100644 --- a/debs/SPECS/wazuh-manager/debian/postinst +++ b/debs/SPECS/wazuh-manager/debian/postinst @@ -264,19 +264,6 @@ case "$1" in fi fi - if [ ! -z "$2" ]; then - if [ -f ${WAZUH_TMP_DIR}/wazuh.restart ] ; then - if command -v systemctl > /dev/null 2>&1 && systemctl > /dev/null 2>&1; then - systemctl daemon-reload > /dev/null 2>&1 - systemctl restart wazuh-manager.service > /dev/null 2>&1 - elif command -v service > /dev/null 2>&1 ; then - service wazuh-manager restart > /dev/null 2>&1 - else - ${DIR}/bin/wazuh-control restart > /dev/null 2>&1 - fi - fi - fi - # Function that checks if the old (< v4.8) VD configuration is present. is_old_vulndet_config_present() { @@ -327,6 +314,19 @@ case "$1" in fi echo "D" + if [ ! -z "$2" ]; then + if [ -f ${WAZUH_TMP_DIR}/wazuh.restart ] ; then + if command -v systemctl > /dev/null 2>&1 && systemctl > /dev/null 2>&1; then + systemctl daemon-reload > /dev/null 2>&1 + systemctl restart wazuh-manager.service > /dev/null 2>&1 + elif command -v service > /dev/null 2>&1 ; then + service wazuh-manager restart > /dev/null 2>&1 + else + ${DIR}/bin/wazuh-control restart > /dev/null 2>&1 + fi + fi + fi + #Delete obsolete files if [ -f /etc/ossec-init.conf ]; then rm -f /etc/ossec-init.conf