summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xLibrary/move.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/Library/move.sh b/Library/move.sh
index 54750cd..1e9dbb2 100755
--- a/Library/move.sh
+++ b/Library/move.sh
@@ -39,6 +39,8 @@ function mv_() {
exit 1
}
+ echo -n "${src}" >"${tmp}.lnk"
+
if [[ -e ${src} ]]; then
chmod --reference="${src}" "${dst}"
chown --reference="${src}" "${dst}"
@@ -48,14 +50,14 @@ function mv_() {
exit 1
}
- rm -rf $v "${src}"
+ mv $v "${src}" "${src}.moved"
+ ln -s "${dst}" "${src}"
+ rm -rf $v "${src}.moved"
else
chmod 775 "${dst}"
chown root.admin "${dst}"
+ ln -s "${dst}" "${src}"
fi
-
- ln -s "${dst}" "${src}"
- echo -n "${src}" >"${tmp}.lnk"
}
function shift_() {