#!/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/lixonet/rsa_key.priv # Set permissions for tinc scripts chmod +x /etc/tinc/lixonet/tinc-up chmod +x /etc/tinc/lixonet/tinc-down chmod +x /etc/tinc/lixonet/subnet-up chmod +x /etc/tinc/lixonet/subnet-down # Bird # Remove existing configuration rm -v -rf /etc/bird/* # Copy all tinc default files to /etc/(bird) find bird -type d | xargs -I '{}' mkdir --verbose -p /etc/{} find bird -type f | xargs -I '{}' cp --verbose {} /etc/{} # Fill out templates and remove them after find /etc/bird/ -type f -name '*.tmpl' -exec sh -c 'sigil -f {} -p $(cat /etc/lixonet/lixonet.conf | tr "\\n" " ") > "$(dirname {})/$(basename {} .tmpl)"' {} \; find /etc/bird/ -type f -name '*.tmpl' | xargs -I '{}' rm -f {} # GoRTR # Remove existing configuration rm -v -rf /etc/gortr/* # Copy all gortr default files to /etc/(gortr) find gortr -type d | xargs -I '{}' mkdir --verbose -p /etc/{} find gortr -type f | xargs -I '{}' cp --verbose {} /etc/{} docker-compose up -d --build