mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 09:04:39 +00:00
system: do not clobber mount points
In case of ZFS a move doesn't really work. Remove links only and move the directory contents over.
This commit is contained in:
parent
50d3f5e738
commit
1eb25c2490
@ -64,22 +64,26 @@ install_mfs_link()
|
||||
remove_mfs_link()
|
||||
{
|
||||
ROOT=${ROOTDIR}
|
||||
MFS=$(dirname ${1})
|
||||
NAME=$(basename ${1})
|
||||
MFS=${1}
|
||||
|
||||
# Persistent copies of MFS-bound directories
|
||||
# still there must be moved back into place.
|
||||
|
||||
if [ -d "${ROOT}${MFS}/${NAME}" ]; then
|
||||
if [ -d "${ROOT}${MFS}" ]; then
|
||||
if [ -L "${MFS}" ]; then
|
||||
# reverse the recovery symlink before
|
||||
# moving back the original database
|
||||
rm "${MFS}"
|
||||
fi
|
||||
mkdir -p "${MFS}"
|
||||
# reverse the recovery symlink before
|
||||
# moving back the original database
|
||||
rm -f "${MFS}/${NAME}"
|
||||
mv "${ROOT}${MFS}/${NAME}" "${MFS}/"
|
||||
for DIR in $(find "${ROOT}${MFS}" -depth 1); do
|
||||
mv "${DIR}" "${MFS}/"
|
||||
done
|
||||
rm -r "${ROOT}${MFS}"
|
||||
fi
|
||||
|
||||
# ensure directory always exist
|
||||
mkdir -p "${MFS}/${NAME}"
|
||||
mkdir -p "${MFS}"
|
||||
}
|
||||
|
||||
# check which directories we need
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user