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