summaryrefslogtreecommitdiffstats
path: root/ship/lib
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2013-12-17 19:34:28 +0100
committermakefu <github@syntax-fehler.de>2013-12-17 19:34:28 +0100
commitafb34a1551c3bfb0bdc15d7059de8c47f31b6700 (patch)
tree4e16e25e74a52ec25bffad4683b714d0dc5f094b /ship/lib
parentec1ab1b0d55a21b223485b27bbc6fa6610f1875a (diff)
esudo is now weaksauce
Diffstat (limited to 'ship/lib')
-rw-r--r--ship/lib/core11
1 files changed, 6 insertions, 5 deletions
diff --git a/ship/lib/core b/ship/lib/core
index 6ae87fa4..d6e01352 100644
--- a/ship/lib/core
+++ b/ship/lib/core
@@ -22,11 +22,12 @@ defer(){
}
esudo(){
- # weaksauce esudo, bail out if we are not root
- if ! is_root; then
- # for the records:
- # exec sudo -E "$0" "$@"
- die "You are not root enough to run this script" 2>&1
+ # becomes root with sudo powers
+ # unless nosudo env is set
+ if test "${nosudo-false}" != true && ! is_root; then
+ echo "we're going sudo..." >&2
+ exec sudo -E "$0" "$@"
+ exit 23 # go to hell
fi
}