diff options
Diffstat (limited to 'dhcpcd-hooks/20-dns.conf')
-rw-r--r-- | dhcpcd-hooks/20-dns.conf | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/dhcpcd-hooks/20-dns.conf b/dhcpcd-hooks/20-dns.conf index a92e91d..6165824 100644 --- a/dhcpcd-hooks/20-dns.conf +++ b/dhcpcd-hooks/20-dns.conf @@ -1,6 +1,13 @@ # Set net.<iface>.dnsN properties that contain the # DNS server addresses given by the DHCP server. +if [[ $interface == p2p* ]] + then + intf=p2p + else + intf=$interface +fi + set_dns_props() { case "${new_domain_name_servers}" in @@ -9,12 +16,12 @@ set_dns_props() count=1 for i in 1 2 3 4; do - setprop dhcp.${interface}.dns${i} "" + setprop dhcp.${intf}.dns${i} "" done count=1 for dnsaddr in ${new_domain_name_servers}; do - setprop dhcp.${interface}.dns${count} ${dnsaddr} + setprop dhcp.${intf}.dns${count} ${dnsaddr} count=$(($count + 1)) done } @@ -22,7 +29,7 @@ set_dns_props() unset_dns_props() { for i in 1 2 3 4; do - setprop dhcp.${interface}.dns${i} "" + setprop dhcp.${intf}.dns${i} "" done } |