Finish up first pass at WG

This commit is contained in:
Manevolent 2021-09-21 15:17:59 -06:00
parent 85841e45cc
commit f4329c810d
No known key found for this signature in database
GPG Key ID: 2E9B7592DFA4F344
2 changed files with 11 additions and 9 deletions

View File

@ -101,13 +101,15 @@ do
process_templates "/etc/bind/$netname/" "$sigil_vars" process_templates "/etc/bind/$netname/" "$sigil_vars"
# Wireguard # Wireguard
# Remove existing configuration if [ $wg_enabled -eq "1" ]; then
rm -v -rf /etc/wireguard/$netname/* # Remove existing configuration
# Copy all bind default files to /etc/(bind) rm -v -rf /etc/wireguard/$netname/*
find wireguard -type d | sed -e "s@wireguard@wireguard/${netname}@g" | xargs -I '{}' mkdir --verbose -p /etc/{} # Copy all bind default files to /etc/(bind)
find wireguard -type f | sed -e "s@wireguard/@@g" | xargs -I '{}' cp --verbose wireguard/{} /etc/wireguard/$netname/{} find wireguard -type d | sed -e "s@wireguard@wireguard/${netname}@g" | xargs -I '{}' mkdir --verbose -p /etc/{}
# Fill out templates and remove them after find wireguard -type f | sed -e "s@wireguard/@@g" | xargs -I '{}' cp --verbose wireguard/{} /etc/wireguard/$netname/{}
process_templates "/etc/wireguard/$netname/" "$sigil_vars" # Fill out templates and remove them after
process_templates "/etc/wireguard/$netname/" "$sigil_vars"
fi
# Docker # Docker
# Copy templates and dependencies to directory # Copy templates and dependencies to directory

View File

@ -1,4 +1,4 @@
image: ghcr.io/linuxserver/wireguard {{ if eq "1" "${wg_enabled:-0}" }} image: ghcr.io/linuxserver/wireguard
container_name: wireguard container_name: wireguard
volumes: volumes:
- /etc/wireguard/${netname}:/config - /etc/wireguard/${netname}:/config
@ -16,4 +16,4 @@
depends_on: depends_on:
- tinc - tinc
sysctls: sysctls:
- net.ipv4.conf.all.src_valid_mark=1 - net.ipv4.conf.all.src_valid_mark=1{{ end }}