only IPv4 from resolve.conf, if IPv6 disabled

Do not copy IPv6 DNS from resolve.conf, if IPV6_SUPPORT is not enabled.
This commit is contained in:
Henry N 2020-04-02 00:29:30 +02:00 committed by GitHub
parent 4ddf640a79
commit 5aee112442
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -755,7 +755,9 @@ ifconfig-pool-persist ipp.txt" >> /etc/openvpn/server.conf
fi
# Obtain the resolvers from resolv.conf and use them for OpenVPN
sed -ne 's/^nameserver[[:space:]]\+\([^[:space:]]\+\).*$/\1/p' $RESOLVCONF | while read -r line; do
echo "push \"dhcp-option DNS $line\"" >> /etc/openvpn/server.conf
if [[ "$line" =~ ^[0-9.]*$ ]] || [[ "$IPV6_SUPPORT" == 'y' ]]; then
echo "push \"dhcp-option DNS $line\"" >> /etc/openvpn/server.conf
fi
done
;;
2)