From: Roy Marples Date: Wed, 1 Oct 2008 11:11:42 +0000 (+0000) Subject: Build the resolv.conf correctly from the last commit. X-Git-Tag: v5.0.0~228 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29062278395e56a38e76cfc1f6f71f13ceb00523;p=thirdparty%2Fdhcpcd.git Build the resolv.conf correctly from the last commit. --- diff --git a/dhcpcd-hooks/20-resolv.conf b/dhcpcd-hooks/20-resolv.conf index 22f2d58f..0d812ca1 100644 --- a/dhcpcd-hooks/20-resolv.conf +++ b/dhcpcd-hooks/20-resolv.conf @@ -24,8 +24,17 @@ build_resolv_conf() done # Build the search list + domain=$(cd "${resolv_conf_dir}"; \ + key_get_value "domain " ${interfaces}) search=$(cd "${resolv_conf_dir}"; \ key_get_value "search " ${interfaces}) + set -- ${domain} + unset domain + if [ -n "$2" ]; then + search="${search} $@" + elif [ -n "$1" ]; then + domain="domain $1\n" + fi [ -n "${search}" ] && search="search $(uniqify ${search})\n" # Build the nameserver list @@ -45,7 +54,7 @@ build_resolv_conf() else echo "# /etc/resolv.conf.head can replace this line" >> "${cf}" fi - printf "${search}${servers}" >> "${cf}" + printf "${domain}${search}${servers}" >> "${cf}" if [ -f /etc/resolv.conf.tail ]; then cat /etc/resolv.conf.tail >> "${cf}" else