mirror of
https://github.com/pcvolkmer/docker-wireguard-boringtun.git
synced 2025-04-19 13:26:50 +00:00
This will add a DNS config to the client configurations pointing to the wireguard server. With this configuration, all DNS requests are sent through the VPN and are no longer answered by the local DNS server. Each client now has a hostname like <device>-client<id>.
18 lines
342 B
Bash
Executable File
18 lines
342 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ ! -f "$DEVICE-client_$1.conf" ]; then
|
|
echo "No client $1"
|
|
exit 1
|
|
fi
|
|
|
|
CONFIG=$(cat "$DEVICE.conf" | sed "/^\# Client $1/{N;N;N;N;d}")
|
|
|
|
echo "$CONFIG" > "$DEVICE.conf"
|
|
|
|
rm "$DEVICE-client_$1.conf" 2>/dev/null
|
|
rm "$DEVICE-client_$1.png" 2>/dev/null
|
|
|
|
# Update dnsmasq hosts file
|
|
/scripts/hosts.sh
|
|
|
|
echo "Client # $1 removed" |