#!/bin/sh #---------------------------------------------------------------------------- # /etc/ppp/ipv6-up200.dhcp __FLI4LVER__ # # called whenever a IPv6 PPP connection over default circuit has come up # and dnsmasq is not installed # # Last Update: $Id$ #---------------------------------------------------------------------------- if [ "$is_default_route" = "yes" -a ! -f /etc/dnsmasq.conf ] then # $interface.usepeerdns existing? if [ -f /var/run/$interface.usepeerdns ] then read usepeerdns < /var/run/$interface.usepeerdns else usepeerdns='no' fi if [ "$usepeerdns" = "yes" ] then # dibbler sets SRV_OPTION23... if [ -n "$SRV_OPTION23" ] then resolv_file=/etc/resolv.conf if lock_resource $(basename $resolv_file) ipv6-up200.dhcp then if [ ! -f $resolv_file.$interface ] then mv $resolv_file $resolv_file.$interface echo "# x_USEPEERDNS is set" > $resolv_file fi for dns in $SRV_OPTION23 do echo "nameserver $dns" >> $resolv_file echo "using nameserver $dns" done unlock_resource $(basename $resolv_file) ipv6-up200.dhcp fi else echo "The DHCPv6 server didn't send any nameserver addresses, DNS forwarders not changed" fi else echo "Using peer DNS servers disabled for $interface" fi fi