summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@xso>2011-08-12 23:14:27 +0200
committertv <tv@xso>2011-08-12 23:14:27 +0200
commit5ea389182e56c6189e418deff8df282f393f9eb4 (patch)
tree302cf97f17c28682cea3012644b26c8125cdc7c6
parent8575d31cabde0e8b3dfaa10a5038701fe69139de (diff)
retiolum tinc_setup: go sudo
-rwxr-xr-xretiolum/scripts/tinc_setup/install.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/retiolum/scripts/tinc_setup/install.sh b/retiolum/scripts/tinc_setup/install.sh
index 9df38df7..0902d417 100755
--- a/retiolum/scripts/tinc_setup/install.sh
+++ b/retiolum/scripts/tinc_setup/install.sh
@@ -1,5 +1,12 @@
#! /bin/sh
# USE WITH GREAT CAUTION
+set -euf
+
+if test "${nosudo-false}" != true -a `id -u` != 0; then
+ echo "we're going sudo..." >&2
+ exec sudo "$0" "$@"
+ exit 23 # go to hell
+fi
#make -C ../../ update
set -e