summaryrefslogtreecommitdiffstats
path: root/dirsu
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xssn.at>2011-05-15 13:59:16 +0200
committerFlorian Pritz <bluewind@xssn.at>2011-05-15 13:59:16 +0200
commitfcb85132b3bb40f054cb775cbffe0e412f064ce6 (patch)
treedb40c63c042ea631a11e5c62cfb2c36ae75b1ba5 /dirsu
parent1cff155acfda9e1ca0b06653897dbb9bcde0a3dd (diff)
downloadbin-fcb85132b3bb40f054cb775cbffe0e412f064ce6.tar.gz
bin-fcb85132b3bb40f054cb775cbffe0e412f064ce6.tar.xz
add dirsu
Signed-off-by: Florian Pritz <bluewind@xssn.at>
Diffstat (limited to 'dirsu')
-rwxr-xr-xdirsu10
1 files changed, 10 insertions, 0 deletions
diff --git a/dirsu b/dirsu
new file mode 100755
index 0000000..08d29d6
--- /dev/null
+++ b/dirsu
@@ -0,0 +1,10 @@
+#!/bin/bash
+set -e
+if [[ -z $1 ]]; then
+ target="$PWD"
+else
+ target="$1"
+fi
+user="$(stat -c %U "$target")"
+cd "$target"
+su "$user" -c "cd $PWD; bash"