From: Roy Marples Date: Fri, 14 Aug 2015 12:35:19 +0000 (+0000) Subject: Build new_domain_name from other sources if blank before checking it's blank X-Git-Tag: v6.9.2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e98443f89bce040b89f9d474b76c16cc64e17e0d;p=thirdparty%2Fdhcpcd.git Build new_domain_name from other sources if blank before checking it's blank to remove any prior config. Fixes [a3aebc3b79] Thanks to Paul Walrath. --- diff --git a/dhcpcd-hooks/20-resolv.conf b/dhcpcd-hooks/20-resolv.conf index d99cc7fa..35c40644 100644 --- a/dhcpcd-hooks/20-resolv.conf +++ b/dhcpcd-hooks/20-resolv.conf @@ -117,14 +117,6 @@ add_resolv_conf() new_domain_name_servers="$new_domain_name_servers${new_domain_name_servers:+ }$new_rdnss" new_domain_search="$new_domain_search${new_domain_search:+ }$new_dnssl" - # If we don't have any configuration, remove it - if [ -z "$new_domain_name_servers" -a \ - -z "$new_domain_name" -a \ - -z "$new_domain_search" ]; then - remove_resolv_conf - return $? - fi - # Derive a new domain from our various hostname options if [ -z "$new_domain_name" ]; then if [ "$new_dhcp6_fqdn" != "${new_dhcp6_fqdn#*.}" ]; then @@ -136,6 +128,14 @@ add_resolv_conf() fi fi + # If we don't have any configuration, remove it + if [ -z "$new_domain_name_servers" -a \ + -z "$new_domain_name" -a \ + -z "$new_domain_search" ]; then + remove_resolv_conf + return $? + fi + if [ -n "$new_domain_name" ]; then set -- $new_domain_name if valid_domainname "$1"; then