summaryrefslogtreecommitdiffstats
path: root/retiolum/bin/update-retiolum-hosts
blob: 7b2fa0e5a3afb48b9a10e3584ff9e376721b1d55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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