]> arthur.barton.de Git - ConfigScripts.git/commitdiff
install.sh: don't set owner (call chown) if not necessary
authorAlexander Barton <alex@barton.de>
Sat, 21 Aug 2010 11:03:22 +0000 (13:03 +0200)
committerAlexander Barton <alex@barton.de>
Sat, 21 Aug 2010 11:03:22 +0000 (13:03 +0200)
install.sh

index ddf2a3da5f9fca638d6dd26729f499006fe1deec..86849bb582b9ce59c4910ffab28177601f787e14 100755 (executable)
@@ -27,8 +27,12 @@ Copy_File() {
        fi
        Msg " "
        cp "$src" "$dst" || Abort
-       [ -n "$own" ] && chown "$own" "$dst" || Abort
-       [ -n "$perm" ] && chmod "$perm" "$dst" || Abort
+       if [ -n "$own" -a "$own" != "$USER" ]; then
+               chown "$own" "$dst" || Abort
+       fi
+       if [ -n "$perm" ]; then
+               chmod "$perm" "$dst" || Abort
+       fi
        Msg "- OK.\n"
 }