Update build.sh

This commit is contained in:
sump pump 2020-05-21 21:36:28 +00:00
parent 500cfd1a78
commit 0159f1fe69

View File

@ -29,7 +29,7 @@ do
rm -v -rf /etc/tinc/$netname/*
# Copy all tinc default files to /etc/(tinc)
find tinc -type d | sed -e "s@tinc@tinc/${netname}@g" | xargs -I '{}' mkdir --verbose -p /etc/{}
find tinc -type f | sed -e "s@tinc@tinc/${netname}@g" | xargs -I '{}' cp --verbose {} /etc/{}
find tinc -type f | sed -e "s@tinc/@@g" | xargs -I '{}' cp --verbose tinc/{} /etc/tinc/$netname/{}
# Fill out templates and remove them after
find /etc/tinc/$netname/ -type f -name '*.tmpl' -exec sh -c 'sigil -f {} -p $(cat /etc/lixonet/$netname/lixonet.conf | tr "\\n" " ") > "$(dirname {})/$(basename {} .tmpl)"' {} \;
find /etc/tinc/$netname/ -type f -name '*.tmpl' | xargs -I '{}' rm -f {}
@ -46,7 +46,7 @@ do
rm -v -rf /etc/bird/$netname/*
# Copy all tinc default files to /etc/(bird)
find bird -type d | sed -e "s@bird@bird/${netname}@g" | xargs -I '{}' mkdir --verbose -p /etc/{}
find bird -type f | sed -e "s@bird@bird/${netname}@g" | xargs -I '{}' cp --verbose {} /etc/{}
find tinc -type f | sed -e "s@bird/@@g" | xargs -I '{}' cp --verbose bird/{} /etc/bird/$netname/{}
# Fill out templates and remove them after
find /etc/bird/$netname/ -type f -name '*.tmpl' -exec sh -c 'sigil -f {} -p $(cat /etc/lixonet/$netname/lixonet.conf | tr "\\n" " ") > "$(dirname {})/$(basename {} .tmpl)"' {} \;
find /etc/bird/$netname/ -type f -name '*.tmpl' | xargs -I '{}' rm -f {}