diff --git a/functions.sh b/functions.sh index 8fe5ae7e..29de20bc 100644 --- a/functions.sh +++ b/functions.sh @@ -502,6 +502,12 @@ dir_prep() { mv -f "$symlink" "$symlink.old" fi + # if the real dir is already a symlink, unlink it first + if [ -L "$real" ]; + then + unlink "$real" + fi + # if the real dir doesn't exist we create it if [ ! -d "$real" ]; then @@ -518,7 +524,7 @@ dir_prep() { if [ -d "$symlink.old" ]; then echo "Moving the data from $symlink.old to $real" #DEBUG - mv -f "$symlink".old/* $real + mv -f "$symlink.old"/{.[!.],}* $real echo "Removing $symlink.old" #DEBUG rm -rf "$symlink.old" fi