Get DNS-IPv6 from current system resolvers
Allow IPv4 and IPv6 to get from resolv.conf. Filter out commets by grepping "nameserver" from beginning of line. No additional comment filter need. Replace multiple grep with single sed.
This commit is contained in:
parent
44105eb060
commit
4ddf640a79
1 changed files with 1 additions and 1 deletions
|
|
@ -754,7 +754,7 @@ ifconfig-pool-persist ipp.txt" >> /etc/openvpn/server.conf
|
|||
RESOLVCONF='/etc/resolv.conf'
|
||||
fi
|
||||
# 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
|
||||
echo "push \"dhcp-option DNS $line\"" >> /etc/openvpn/server.conf
|
||||
done
|
||||
;;
|
||||
|
|
|
|||
Loading…
Reference in a new issue