Use rsync during jail conversion

This commit is contained in:
Jose
2020-01-04 15:50:36 -04:00
parent b5c1bc4da1
commit cd5f6ae917
3 changed files with 5 additions and 4 deletions
+1
View File
@@ -3,6 +3,7 @@
====================== ======================
Version Description Version Description
1.0.33......Use rsync during jail conversion.
1.0.32......Code improvements. 1.0.32......Code improvements.
1.0.31......Fix issue with names containing dashes. 1.0.31......Fix issue with names containing dashes.
1.0.30......Ability to convert thin jail to thick jail. 1.0.30......Ability to convert thin jail to thick jail.
+3 -3
View File
@@ -812,7 +812,7 @@ thickjail_install()
convert_symlinks() convert_symlinks()
{ {
# Work with the symlinks, revert on first cp error. # Work with the symlinks, revert on first rsync error.
if [ -d "${bastille_releasesdir}/${RELEASE}" ]; then if [ -d "${bastille_releasesdir}/${RELEASE}" ]; then
# Retrieve old symlinks temporarily. # Retrieve old symlinks temporarily.
for _link in ${SYMLYNKS}; do for _link in ${SYMLYNKS}; do
@@ -824,7 +824,7 @@ convert_symlinks()
# Copy new files to destination jail. # Copy new files to destination jail.
for _link in ${SYMLYNKS}; do for _link in ${SYMLYNKS}; do
if [ ! -d "${_link}" ]; then if [ ! -d "${_link}" ]; then
cp -a "${bastille_releasesdir}/${RELEASE}/${_link}" "${bastille_jailsdir}/${TARGET}/root/${_link}" rsync -a "${bastille_releasesdir}/${RELEASE}/${_link}/" "${bastille_jailsdir}/${TARGET}/root/${_link}/"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
revert_convert revert_convert
fi fi
@@ -844,7 +844,7 @@ convert_symlinks()
revert_convert() revert_convert()
{ {
# Revert the conversion on first cp error. # Revert the conversion on first rsync error.
echo -e "A problem has occurred while copying the files, reverting changes..." echo -e "A problem has occurred while copying the files, reverting changes..."
for _link in ${SYMLYNKS}; do for _link in ${SYMLYNKS}; do
if [ -d "${_link}" ]; then if [ -d "${_link}" ]; then
+1 -1
View File
@@ -1 +1 @@
1.0.32 1.0.33