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-hosts13
1 files changed, 13 insertions, 0 deletions
diff --git a/retiolum/bin/update-retiolum-hosts b/retiolum/bin/update-retiolum-hosts
new file mode 100755
index 00000000..7b2fa0e5
--- /dev/null
+++ b/retiolum/bin/update-retiolum-hosts
@@ -0,0 +1,13 @@
+#! /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
+pkill -HUP tincd
+pkill -ALRM tincd