#!/bin/sh #---------------------------------------------------------------------------- # /etc/ppp/ipv6-up200.dns __FLI4LVER__ # # called whenever a IPv6 PPP connection over default circuit has come up # and dnsmasq is 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.dnsmasq if lock_resource $(basename $resolv_file) ipv6-up200.dns then if [ ! -f $resolv_file.bak ] then mv $resolv_file $resolv_file.bak echo "# x_USEPEERDNS is set" > $resolv_file chown dns:dns $resolv_file fi for dns in $(echo "$SRV_OPTION23" | sed 's/ \+/\n/g' | sort -u) do echo "nameserver $dns" >> $resolv_file echo "using nameserver $dns" done killall -HUP dnsmasq unlock_resource $(basename $resolv_file) ipv6-up200.dns 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