summaryrefslogtreecommitdiffstats
path: root/lib/libkrebs.sh
diff options
context:
space:
mode:
authortv <tv@xso>2011-08-13 16:06:03 +0200
committertv <tv@xso>2011-08-13 16:06:03 +0200
commit3cdc6aed8b5852249c1410f786acf84fcab8b153 (patch)
treefc79e03e52dd3b9e2012e642732415c20bbb0f8f /lib/libkrebs.sh
parentc36f72a019abcd22fca3dc550e1a239c1d161f1f (diff)
lib: add libkrebs.sh
Diffstat (limited to 'lib/libkrebs.sh')
-rw-r--r--lib/libkrebs.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/libkrebs.sh b/lib/libkrebs.sh
new file mode 100644
index 00000000..d423a053
--- /dev/null
+++ b/lib/libkrebs.sh
@@ -0,0 +1,10 @@
+#! /bin/sh
+esudo() {
+ if test "${esudo-true}" = true -a `id -u` != 0; then
+ echo "we're going sudo..." >&2
+ export esudo=false
+ exec sudo "$0" "$@"
+ exit 23 # go to hell
+ fi
+}
+