diff --git a/build.sh b/build.sh index 5389602..09cca49 100644 --- a/build.sh +++ b/build.sh @@ -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