From: Roy Marples Date: Sun, 28 Jul 2013 10:36:24 +0000 (+0000) Subject: If we are lacking a domain option, derive one from the hostname if X-Git-Tag: v6.0.4~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8987030539b26547c1ea57d05dc273ee29f31c02;p=thirdparty%2Fdhcpcd.git If we are lacking a domain option, derive one from the hostname if we can. --- diff --git a/dhcpcd-hooks/20-resolv.conf b/dhcpcd-hooks/20-resolv.conf index 4610079d..13b8137e 100644 --- a/dhcpcd-hooks/20-resolv.conf +++ b/dhcpcd-hooks/20-resolv.conf @@ -89,6 +89,18 @@ add_resolv_conf() return $? fi + # Derive a new domain from our various hostname options + new_domain_name= + if [ -z "$new_domain_name" ]; then + if [ "$new_dhcp6_fqdn" != "${new_dhcp6_fqdn#*.}" ]; then + new_domain_name="${new_dhcp6_fqdn#*.}" + elif [ "$new_fqdn" != "${new_fqdn#*.}" ]; then + new_domain_name="${new_fqdn#*.}" + elif [ "$new_host_name" != "${new_host_name#*.}" ]; then + new_domain_name="${new_host_name#*.}" + fi + fi + if [ -n "$new_domain_name" ]; then set -- $new_domain_name new_domain_name="$1"