diff --git a/salt/common/tools/sbin/soup b/salt/common/tools/sbin/soup index de7614561..c9ba0fa1f 100755 --- a/salt/common/tools/sbin/soup +++ b/salt/common/tools/sbin/soup @@ -872,13 +872,17 @@ apply_hotfix() { fix_wazuh() { FILE="/nsm/wazuh/etc/ossec.conf" - echo "Detecting if ossec.conf needs corrected..." - if head -1 $FILE | grep -q "xml version"; 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." + 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 + so-wazuh-restart + 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 }