Default wg_enabled=0

This commit is contained in:
Manevolent 2021-09-21 15:50:44 -06:00
parent 9d06479695
commit aa05a2d45b
No known key found for this signature in database
GPG Key ID: 2E9B7592DFA4F344

View File

@ -101,10 +101,10 @@ do
process_templates "/etc/bind/$netname/" "$sigil_vars"
# Wireguard
if [ "$wg_enabled" -eq "1" ]; then
if [ "${wg_enabled:-0}" -eq "1" ]; then
# Remove existing configuration
rm -v -rf /etc/wireguard/$netname/*
# Copy all bind default files to /etc/(bind)
# 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