On Wed, Oct 05, 2005 at 07:56:54PM +0200, Tadeusz Kijkowski wrote:
> Package: dhcp3-client
> Version: 3.0.3-3
> Severity: wishlist
> Tags: patch
> 
> Currently dhclient-script overwrites resolv.conf entirely.
> IMO it should keep entries that are not concerned by dhcp (like
> options). It should also keep old 'search' if domain name is not
> provided by dhcp server.

Have you considered resolvconf? I'm considering incorporating this patch,
however I think that resolvconf is already handling what you want pretty
well.
 
> --- dhclient-script-orig        2005-09-16 14:15:00.000000000 +0200
> +++ dhclient-script     2005-10-05 19:29:41.000000000 +0200
> @@ -15,15 +15,19 @@
>      if [ -n "$new_domain_name" -o -n "$new_domain_name_servers" ]; then
>          local new_resolv_conf=/etc/resolv.conf.dhclient-new
>          rm -f $new_resolv_conf
> +       # copy old file excluding nameserver and search parameters
> +       grep -v -i '^[[:space:]]*\(search\)\|\(nameserver\)'
> /etc/resolv.conf >>$new_resolv_conf
>          if [ -n "$new_domain_name" ]; then
>              echo search $new_domain_name >>$new_resolv_conf
> +       else # keep old domain name
> +            grep -i '^[[:space:]]*search' /etc/resolv.conf
> >>$new_resolv_conf
>          fi
>          if [ -n "$new_domain_name_servers" ]; then
>                     for nameserver in $new_domain_name_servers; do
>                         echo nameserver $nameserver >>$new_resolv_conf
>              done
> -        else # keep 'old' nameservers
> -            sed -n /^\w*[Nn][Aa][Mm][Ee][Ss][Ee][Rr][Vv][Ee][Rr]/p
>              /etc/resolv.conf >>$new_resolv_conf
> +        else # keep old nameservers
> +            grep -i '^[[:space:]]*nameserver' /etc/resolv.conf
> >>$new_resolv_conf
>          fi
>          chown --reference=/etc/resolv.conf $new_resolv_conf
>          chmod --reference=/etc/resolv.conf $new_resolv_conf
> 
> -- System Information:
> Debian Release: testing/unstable
>   APT prefers testing
>   APT policy: (500, 'testing')
> Architecture: i386 (i686)
> Shell:  /bin/sh linked to /bin/bash
> Kernel: Linux 2.6.12-1-686
> Locale: LANG=pl_PL, LC_CTYPE=pl_PL (charmap=ISO-8859-2)
> 
> Versions of packages dhcp3-client depends on:
> ii  debconf                       1.4.58     Debian configuration management 
> sy
> ii  debianutils                   2.14.3     Miscellaneous utilities specific 
> t
> ii  dhcp3-common                  3.0.3-3    Common files used by all the 
> dhcp3
> ii  libc6                         2.3.5-6    GNU C Library: Shared libraries 
> an
> 
> dhcp3-client recommends no packages.
> 
> -- no debconf information
> 
> 


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to