mirror of
https://github.com/wazuh/wazuh-docker.git
synced 2025-10-23 04:51:57 +00:00
New validation of empty dir
This commit is contained in:
@@ -41,12 +41,16 @@ exec_cmd_stdout() {
|
||||
|
||||
mount_permanent_data() {
|
||||
for permanent_dir in "${PERMANENT_DATA[@]}"; do
|
||||
data_tmp="${WAZUH_INSTALL_PATH}/data_tmp/permanent${permanent_dir}/"
|
||||
print ${data_tmp}
|
||||
# Check if the path is not empty
|
||||
if find ${permanent_dir} -mindepth 1 | read; then
|
||||
print "The path ${permanent_dir} is already mounted"
|
||||
else
|
||||
print "Installing ${permanent_dir}"
|
||||
exec_cmd "cp -a ${WAZUH_INSTALL_PATH}/data_tmp/permanent${permanent_dir}/. ${permanent_dir}"
|
||||
if find ${data_tmp} -mindepth 1 | read; then
|
||||
print "Installing ${permanent_dir}"
|
||||
exec_cmd "cp -a ${data_tmp}. ${permanent_dir}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
Reference in New Issue
Block a user