1
1
mirror of https://github.com/angristan/wireguard-install.git synced 2024-06-05 13:00:48 +00:00

Merge pull request #1 from chrislewicki/trailing-comma-fix

add check for secondary DNS
This commit is contained in:
Chris Lewicki 2020-05-05 19:56:21 -04:00 committed by GitHub
commit 04e678dd8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,7 +39,14 @@ function addClient() {
echo "[Interface]
PrivateKey = $CLIENT_PRIV_KEY
Address = $CLIENT_WG_IPV4/24,$CLIENT_WG_IPV6/64
DNS = $CLIENT_DNS_1,$CLIENT_DNS_2
# Fix for bug where trailing comma is left if no secondary DNS specified
if [ -z "$CLIENT_DNS_2" ]
then
DNS = $CLIENT_DNS_1,$CLIENT_DNS_2
else
DNS = $CLIENT_DNS_1
fi
[Peer]
PublicKey = $SERVER_PUB_KEY