Package: wide-dhcpv6-client
Version: 20060322-2
Severity: wishlist
Tags: patch

The dhcp6c-script handles setting the domain name en nameservers. This
patch adds a check for 'resolvconf' and uses it if available.

Unfortunately i do not know in what variable the interface that is being
configured is stored, so I had to include it with a static variable ``IFACE''.

I also changed the shell from /bin/bash to /bin/sh.

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (990, 'testing'), (200, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/dash
Kernel: Linux 2.6.16-1-686
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages wide-dhcpv6-client depends on:
ii  debconf [debconf-2.0]         1.5.0      Debian configuration management sy
ii  libc6                         2.3.6-7    GNU C Library: Shared libraries
ii  sharutils                     1:4.2.1-15 shar, unshar, uuencode, uudecode

wide-dhcpv6-client recommends no packages.

-- debconf information:
* wide-dhcpv6-client/interfaces: eth2 eth0
* wide-dhcpv6-client/config_warn:
--- dhcp6c-script.old   2006-05-31 12:19:48.000000000 +0200
+++ dhcp6c-script       2006-05-31 12:09:06.000000000 +0200
@@ -1,7 +1,10 @@
 #!/bin/sh
 # dhcp6c-script for Debian/Ubuntu. Jérémie Corbier, April, 2006.
 
+RESOLVCONF="/sbin/resolvconf"
+IFACE="eth2"
+
 if [ -n "$new_domain_name" -o -n "$new_domain_name_servers" ]; then
     new_resolv_conf=/etc/resolv.conf.dhcp6c-new
     rm -f $new_resolv_conf
     if [ -n "$new_domain_name" ]; then
@@ -11,12 +14,18 @@
         for nameserver in $new_domain_name_servers; do
             echo nameserver $nameserver >> $new_resolv_conf
         done
     fi
-    # To preserve IPv4 informations...
-    cat /etc/resolv.conf >> $new_resolv_conf
-    chown --reference=/etc/resolv.conf $new_resolv_conf
-    chmod --reference=/etc/resolv.conf $new_resolv_conf
-    mv -f $new_resolv_conf /etc/resolv.conf
+
+    # use resolvconf if available
+    if [ -h "/etc/resolv.conf" -a -x "$RESOLVCONF" ]; then
+        cat $new_resolv_conf | $RESOLVCONF -a $IFACE
+    else
+        # To preserve IPv4 informations...
+        cat /etc/resolv.conf >> $new_resolv_conf
+        chown --reference=/etc/resolv.conf $new_resolv_conf
+        chmod --reference=/etc/resolv.conf $new_resolv_conf
+        mv -f $new_resolv_conf /etc/resolv.conf
+    fi
 fi
 
 exit 0

Reply via email to