#!/bin/sh #---------------------------------------------------------------------------- # /etc/ppp/ip-up200.dhcp __FLI4LVER__ # # called whenever an IPv4 PPP connection over default circuit has come up # and dnsmasq is not installed # # Creation: ??.??.2003 lanspezi # 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 # dhcpcd/dhclient set DNS1 and DNS2 if [ "$DNS1" -o "$DNS2" ] then resolv_file=/etc/resolv.conf if lock_resource $(basename $resolv_file) ip-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 $DNS1 $DNS2 do echo "nameserver $dns" >> $resolv_file echo "using nameserver $dns" done unlock_resource $(basename $resolv_file) ip-up200.dhcp fi else echo "The DHCPv4 server didn't send any nameserver addresses, DNS forwarders not changed" fi else echo "Using peer DNS servers disabled for $interface" fi fi