mirror of
https://github.com/wazuh/wazuh-docker.git
synced 2025-10-23 06:11:57 +00:00
Fix permanent data scripts
This commit is contained in:
@@ -47,12 +47,8 @@ mount_permanent_data() {
|
|||||||
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 ${data_tmp}. ${permanent_dir}"
|
exec_cmd "cp -ar ${data_tmp}. ${permanent_dir}"
|
||||||
else
|
|
||||||
print "The path ${permanent_dir} is empty, skipped"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
@@ -30,11 +30,7 @@ mkdir ${PERMANENT_PATH}
|
|||||||
for permanent_dir in "${PERMANENT_DATA[@]}"; do
|
for permanent_dir in "${PERMANENT_DATA[@]}"; do
|
||||||
# Create the directory for the permanent file if it does not exist
|
# Create the directory for the permanent file if it does not exist
|
||||||
DIR=$(dirname "${permanent_dir}")
|
DIR=$(dirname "${permanent_dir}")
|
||||||
if [ ! -e ${PERMANENT_PATH}${DIR} ]
|
mkdir -p ${PERMANENT_PATH}${DIR}
|
||||||
then
|
cp -ar ${permanent_dir} ${PERMANENT_PATH}${DIR}
|
||||||
mkdir -p ${PERMANENT_PATH}${DIR}
|
|
||||||
fi
|
|
||||||
|
|
||||||
mv ${permanent_dir} ${PERMANENT_PATH}${permanent_dir}
|
|
||||||
|
|
||||||
done
|
done
|
||||||
|
Reference in New Issue
Block a user