summaryrefslogtreecommitdiffstats
path: root/retiolum/bin/update-retiolum-hosts
diff options
context:
space:
mode:
Diffstat (limited to 'retiolum/bin/update-retiolum-hosts')
-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