Add 2.3.90 WAZUH hotfix corrective function

This commit is contained in:
Jason Ertel
2021-11-23 12:21:28 -05:00
parent 0dd251e2a9
commit 7627d37386

View File

@@ -837,6 +837,21 @@ verify_latest_update_script() {
fi 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
else
echo "$FILE does not have an XML header, so no changes are necessary."
fi
fi
}
main() { main() {
trap 'check_err $?' EXIT trap 'check_err $?' EXIT
@@ -893,6 +908,7 @@ main() {
if [ "$is_hotfix" == "true" ]; then if [ "$is_hotfix" == "true" ]; then
echo "Applying $HOTFIXVERSION" echo "Applying $HOTFIXVERSION"
copy_new_files copy_new_files
apply_hotfix
echo "" echo ""
update_version update_version
salt-call state.highstate -l info queue=True salt-call state.highstate -l info queue=True