Update build.sh

This commit is contained in:
Manevolent 2023-04-23 18:04:28 -06:00 committed by GitHub
parent 737f8c9655
commit fa351ef810
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,7 +28,7 @@ for dir in `find /etc/lixonet/* -type d -maxdepth 0`
do
dir=${dir%*/} # remove the trailing "/"
netname=${dir##*/} # print everything after the final "/"
config_out="/etc/lixonet/${netname}/.config/"
config_out="/etc/lixonet/${netname}/.config"
# Load relevant environment variables from lixonet.conf
unset git
@ -95,7 +95,7 @@ do
rm -v -rf $config_out/tinc/*
# Copy all tinc default files to /etc/(tinc)
find tinc -type d | xargs -I '{}' mkdir --verbose -p $config_out/{}
find tinc -type f | sed -e "s@tinc/@@g" | xargs -I '{}' cp --verbose tinc/{} $config_out/tinc{}
find tinc -type f | sed -e "s@tinc/@@g" | xargs -I '{}' cp --verbose tinc/{} $config_out/tinc/{}
# Build list of all peer IP addresses
tinc_peers=$(cat $config_out/tinc/hosts/* | grep 'Subnet' | grep '/32' | grep -oE '((1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])' | sed -e ':a;N;$!ba;s/\n/,/g')
sigil_vars=$(echo "$sigil_vars tinc_peers=$tinc_peers")