mirror of
https://github.com/angristan/openvpn-install.git
synced 2024-11-22 00:39:03 +01:00
feat(install): get system IPv6 resolvers if enabled (#599)
This commit is contained in:
parent
96e6ea71e9
commit
182c43316f
@ -780,8 +780,11 @@ ifconfig-pool-persist ipp.txt" >>/etc/openvpn/server.conf
|
|||||||
RESOLVCONF='/etc/resolv.conf'
|
RESOLVCONF='/etc/resolv.conf'
|
||||||
fi
|
fi
|
||||||
# Obtain the resolvers from resolv.conf and use them for OpenVPN
|
# Obtain the resolvers from resolv.conf and use them for OpenVPN
|
||||||
grep -v '#' $RESOLVCONF | grep 'nameserver' | grep -E -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | while read -r line; do
|
sed -ne 's/^nameserver[[:space:]]\+\([^[:space:]]\+\).*$/\1/p' $RESOLVCONF | while read -r line; do
|
||||||
|
# Copy, if it's a IPv4 |or| if IPv6 is enabled, IPv4/IPv6 does not matter
|
||||||
|
if [[ $line =~ ^[0-9.]*$ ]] || [[ $IPV6_SUPPORT == 'y' ]]; then
|
||||||
echo "push \"dhcp-option DNS $line\"" >>/etc/openvpn/server.conf
|
echo "push \"dhcp-option DNS $line\"" >>/etc/openvpn/server.conf
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
2) # Self-hosted DNS resolver (Unbound)
|
2) # Self-hosted DNS resolver (Unbound)
|
||||||
|
Loading…
Reference in New Issue
Block a user