From 0bf9766883dc1afb1835e8f7bc95fe25a9a69dad Mon Sep 17 00:00:00 2001 From: Mayte Ariza Date: Mon, 15 Jul 2019 08:37:31 +0200 Subject: [PATCH] Check if file exists before removing it (#209) --- wazuh/config/01-wazuh.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wazuh/config/01-wazuh.sh b/wazuh/config/01-wazuh.sh index 07cb33db..dbdb1076 100644 --- a/wazuh/config/01-wazuh.sh +++ b/wazuh/config/01-wazuh.sh @@ -84,8 +84,9 @@ apply_exclusion_data() { remove_data_files() { for del_file in "${PERMANENT_DATA_DEL[@]}"; do - print "Removing ${del_file}" - exec_cmd "rm ${del_file}" + if [ -e ${del_file} ] + print "Removing ${del_file}" + exec_cmd "rm ${del_file}" done }