]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Build the resolv.conf correctly from the last commit.
authorRoy Marples <roy@marples.name>
Wed, 1 Oct 2008 11:11:42 +0000 (11:11 +0000)
committerRoy Marples <roy@marples.name>
Wed, 1 Oct 2008 11:11:42 +0000 (11:11 +0000)
dhcpcd-hooks/20-resolv.conf

index 22f2d58f6de101bf6e7e7958d7d8e78eace3cdf1..0d812ca18e92a3fe44883e3a81923849cb62da73 100644 (file)
@@ -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