summaryrefslogtreecommitdiffstats
path: root/retiolum/bin
diff options
context:
space:
mode:
authortv <tv@xso>2011-08-12 23:23:33 +0200
committertv <tv@xso>2011-08-12 23:23:33 +0200
commit2048448601aa27f993268ef67bf0eeda3625ef4e (patch)
tree1e7dcd3ec26e20e14bca59418ea3a84fbfc48fc9 /retiolum/bin
parent533add06bf1c5dfb2824c4f861b9288fe5448c4d (diff)
retiolum: go more enterprise
Diffstat (limited to 'retiolum/bin')
-rwxr-xr-xretiolum/bin/update-retiolum-hosts11
1 files changed, 11 insertions, 0 deletions
diff --git a/retiolum/bin/update-retiolum-hosts b/retiolum/bin/update-retiolum-hosts
new file mode 100755
index 00000000..57a8381a
--- /dev/null
+++ b/retiolum/bin/update-retiolum-hosts
@@ -0,0 +1,11 @@
+#! /bin/sh
+set -eu
+
+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
+
+mkdir -v -p /etc/tinc/retiolum/hosts
+cp -v -r hosts/* /etc/tinc/retiolum/hosts