]> gitweb.fluxo.info Git - scripts.git/commitdiff
Adds chownme
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 30 Mar 2015 12:30:12 +0000 (09:30 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 30 Mar 2015 12:30:12 +0000 (09:30 -0300)
chownme [new file with mode: 0755]

diff --git a/chownme b/chownme
new file mode 100755 (executable)
index 0000000..d0a801d
--- /dev/null
+++ b/chownme
@@ -0,0 +1,18 @@
+#!/bin/bash
+#
+# Chown a destination to the current user.
+#
+
+# Parameters
+BASENAME="`basename $0`"
+DEST="$*"
+ME="$(whoami)"
+
+# Check
+if [ -z "$1" ]; then
+  echo "usage: $BASENAME <dest>"
+  exit 1
+fi
+
+# Proceed
+chown -R $ME. $DEST