mirror of
https://github.com/myvesta/vesta
synced 2025-08-19 21:04:07 -07:00
Update v-move-folder-and-make-symlink
This commit is contained in:
parent
dc1979461e
commit
24908aede1
1 changed files with 8 additions and 7 deletions
|
@ -66,19 +66,20 @@ fi
|
||||||
# Action #
|
# Action #
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
rsync -a "$FROMFOLDER/" "$TOFOLDER/"
|
|
||||||
# with slashes on the end of the path of both folders
|
|
||||||
if [ "$?" -ne 0 ]; then
|
|
||||||
echo "Error happened, aborting"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$FROMFOLDER" = "/home/$USER" ] && [ -d "$FROMFOLDER/conf" ]; then
|
if [ "$FROMFOLDER" = "/home/$USER" ] && [ -d "$FROMFOLDER/conf" ]; then
|
||||||
# if we are moving myVesta home folder, we must remove immutable attribute from conf/ files
|
# if we are moving myVesta home folder, we must remove immutable attribute from conf/ files
|
||||||
chattr -R -i "$FROMFOLDER/conf/" > /dev/null 2>&1
|
chattr -R -i "$FROMFOLDER/conf/" > /dev/null 2>&1
|
||||||
# with slashes on the end of the path of the folder
|
# with slashes on the end of the path of the folder
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# rsync -a "$FROMFOLDER/" "$TOFOLDER/"
|
||||||
|
mv "$FROMFOLDER" "$TOFOLDER"
|
||||||
|
# with slashes on the end of the path of both folders
|
||||||
|
if [ "$?" -ne 0 ]; then
|
||||||
|
echo "Error happened, aborting"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
rm -rf "$FROMFOLDER"
|
rm -rf "$FROMFOLDER"
|
||||||
# without slash on the end of the path of the folder
|
# without slash on the end of the path of the folder
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue