check that ossec.conf exists

This commit is contained in:
m0duspwnens
2022-01-06 12:39:48 -05:00
parent 7bb9b6efa9
commit cd590b894a

View File

@@ -872,7 +872,8 @@ apply_hotfix() {
fix_wazuh() {
FILE="/nsm/wazuh/etc/ossec.conf"
echo "Detecting if ossec.conf needs corrected..."
echo "Detecting if $FILE needs corrected..."
if [ -f "$FILE" ]; then
if head -1 $FILE | grep -q "xml version"; then
echo "$FILE has an XML header; removing"
sed -i 1d $FILE
@@ -880,6 +881,9 @@ fix_wazuh() {
else
echo "$FILE does not have an XML header, so no changes are necessary."
fi
else
echo "$FILE does not exist, so no changes are necessary."
fi
}
main() {