diff options
Diffstat (limited to 'Library/move.sh')
-rwxr-xr-x | Library/move.sh | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Library/move.sh b/Library/move.sh index 0b9e09d..3cbe799 100755 --- a/Library/move.sh +++ b/Library/move.sh @@ -2,6 +2,13 @@ shopt -s extglob nullglob +if [[ ${1:0:1} == - ]]; then + v=$1 + shift 1 +else + v= +fi + function df_() { free=$(df -B1 "$1") free=${free% *%*} @@ -20,12 +27,12 @@ function mv_() { chmod --reference="${src}" "${dst}" chown --reference="${src}" "${dst}" - cp -aT "${src}" "${dst}" || { + cp -aT $v "${src}" "${dst}" || { rm -rf "${dst}" exit 1 } - rm -rf "${src}" + rm -rf $v "${src}" else chmod 775 "${dst}" chown root.admin "${dst}" |