lixonet-ee/build.sh
2020-04-27 22:08:29 +00:00

20 lines
634 B
Bash

#!/bin/ash
# Tinc
# Remove existing configuration
rm -v -rf /etc/tinc/*
# Copy all tinc default files to /etc/(tinc)
find tinc -type d | xargs -I '{}' mkdir --verbose -p /etc/{}
find tinc -type f | xargs -I '{}' cp --verbose {} /etc/{}
# Fill out templates and remove them after
find /etc/tinc/ -type f -name '*.tmpl' -exec sh -c 'sigil -f {} -p $(cat /etc/lixonet/lixonet.conf | tr "\\n" " ") > "$(dirname {})/$(basename {} .tmpl)"' {} \;
find /etc/tinc/ -type f -name '*.tmpl' | xargs -I '{}' rm -f {}
# Copy private key
cp /etc/lixonet/tinc.key /etc/tinc/rsa_key.priv
# Bird
rm -rf /etc/bird/*
docker-compose up -d --build