diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:43:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:43:03 +0000 |
commit | f504d0d8a469f3f913a853e97020112fcf262c1b (patch) | |
tree | 25a4b573f8fc510c99d931a382598bee699a215c /debian/scripts/dhcp6c-script | |
parent | Adding upstream version 20080615. (diff) | |
download | wide-dhcpv6-f504d0d8a469f3f913a853e97020112fcf262c1b.tar.xz wide-dhcpv6-f504d0d8a469f3f913a853e97020112fcf262c1b.zip |
Adding debian version 20080615-23.debian/20080615-23debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | debian/scripts/dhcp6c-script | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/debian/scripts/dhcp6c-script b/debian/scripts/dhcp6c-script new file mode 100644 index 0000000..e6168f4 --- /dev/null +++ b/debian/scripts/dhcp6c-script @@ -0,0 +1,40 @@ +#!/bin/sh +# dhcp6c-script for Debian/Ubuntu. Jérémie Corbier, April, 2006. +# resolvconf support by Mattias Guns, May 2006. + +RESOLVCONF="/sbin/resolvconf" + +[ -f /etc/default/wide-dhcpv6-client ] && . /etc/default/wide-dhcpv6-client + +if [ -n "$new_domain_name" -o -n "$new_domain_name_servers" ]; then + old_resolv_conf=/etc/resolv.conf + new_resolv_conf=/etc/resolv.conf.dhcp6c-new + rm -f $new_resolv_conf + if [ -n "$new_domain_name" ]; then + echo search $new_domain_name >> $new_resolv_conf + fi + if [ -n "$new_domain_name_servers" ]; then + for nameserver in $new_domain_name_servers; do + # No need to add an already existing nameserver + res=$(grep "nameserver $nameserver" $old_resolv_conf) + if [ -z "$res" ]; then + echo nameserver $nameserver >> $new_resolv_conf + fi + done + fi + + # Use resolvconf if available + if [ -h "$old_resolv_conf" -a -x "$RESOLVCONF" ]; then + for IFACE in $INTERFACES; do + cat $new_resolv_conf | $RESOLVCONF -a $IFACE + done + else + # To preserve IPv4 informations... + cat $old_resolv_conf >> $new_resolv_conf + chown --reference=$old_resolv_conf $new_resolv_conf + chmod --reference=$old_resolv_conf $new_resolv_conf + mv -f $new_resolv_conf $old_resolv_conf + fi +fi + +exit 0 |