diff --git a/HOTFIX b/HOTFIX index f6989f3fe..0f3ca3c28 100644 --- a/HOTFIX +++ b/HOTFIX @@ -1 +1 @@ -WAZUH +WAZUH diff --git a/salt/common/tools/sbin/soup b/salt/common/tools/sbin/soup index b497d9c24..2aefc67bb 100755 --- a/salt/common/tools/sbin/soup +++ b/salt/common/tools/sbin/soup @@ -837,6 +837,24 @@ verify_latest_update_script() { fi } +apply_hotfix() { + if [[ "$INSTALLEDVERSION" == "2.3.90" && "$HOTFIXVERSION" == "WAZUH" ]] ; then + FILE="/nsm/wazuh/etc/ossec.conf" + echo "Detecting if ossec.conf needs corrected..." + WAZUHHEADER=$(head -1 $FILE | grep "xml version") + if [[ ! -z "$WAZUHHEADER" ]]; then + echo "$FILE has an XML header; removing" + sed -i 1d $FILE + so-wazuh-restart + else + echo "$FILE does not have an XML header, so no changes are necessary." + fi + else + echo "Skipping ossec.conf check ($INSTALLEDVERSION/$HOTFIXVERSION)" + fi +} + + main() { trap 'check_err $?' EXIT @@ -891,9 +909,10 @@ main() { set -e if [ "$is_hotfix" == "true" ]; then - echo "Applying $HOTFIXVERSION" + echo "Applying $HOTFIXVERSION hotfix" copy_new_files - echo "" + apply_hotfix + echo "Hotfix applied" update_version salt-call state.highstate -l info queue=True else