Update build.sh

This commit is contained in:
Manevolent 2023-03-21 13:05:32 -06:00 committed by GitHub
parent 916759a299
commit e71ca41f7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -103,25 +103,28 @@ do
# Fill out templates and remove them after
process_templates "/etc/bind/$netname/" "$sigil_vars"
# Wireguard
if [ "${wg_enabled:-0}" -eq "1" ]; then
# Remove existing configuration
rm -v -rf /etc/wireguard/$netname/*
# Copy all wireguard default files to /etc/(wireguard)
find wireguard -type d | sed -e "s@wireguard@wireguard/${netname}@g" | xargs -I '{}' mkdir --verbose -p /etc/{}
find wireguard -type f | sed -e "s@wireguard/@@g" | xargs -I '{}' cp --verbose wireguard/{} /etc/wireguard/$netname/{}
# Fill out templates and remove them after
process_templates "/etc/wireguard/$netname/" "$sigil_vars"
fi
# Wireguard
if [ "${wg_enabled:-0}" -eq "1" ]; then
# Remove existing configuration
rm -v -rf /etc/wireguard/$netname/*
# Copy all wireguard default files to /etc/(wireguard)
find wireguard -type d | sed -e "s@wireguard@wireguard/${netname}@g" | xargs -I '{}' mkdir --verbose -p /etc/{}
find wireguard -type f | sed -e "s@wireguard/@@g" | xargs -I '{}' cp --verbose wireguard/{} /etc/wireguard/$netname/{}
# Fill out templates and remove them after
process_templates "/etc/wireguard/$netname/" "$sigil_vars"
fi
# Docker
# Copy templates and dependencies to directory
mkdir docker/
cp -rv ../docker/* docker/
if [ "${wg_enabled:-0}" -eq "1" ]; then
cp docker/services.opt/wireguard docker/services/wireguard
cp docker/services.opt/wireguard_router docker/services/wireguard_router
fi
if [ "${wg_enabled:-0}" -eq "1" ]; then
cp docker/services.opt/wireguard docker/services/wireguard
cp docker/services.opt/wireguard_router docker/services/wireguard_router
fi
if [ "${ddns_enabled:-0}" -eq "1" ]; then
cp docker/services.opt/ddns docker/services/ddns
fi
cp -rv $dir/docker/* docker/
cp -v ./../docker-compose.yml.tmpl .