#!/bin/sh
# 
# Coyote PPP Dial-up ip-up Script for a PPPoE 'Dial-on-Demand '
#	called by: pppd
#              called after PPP connection is made
# Created by: Michael Kablitz <mkab@deutschsoft.com>
# 07-23-2000

# Call the firewall script after the IP link comes up
/etc/rc.d/rc.firewall $* $0

# This code allows automatic configuration of your resolv.conf
# for peer supplied DNS addresses.
# Original resolv.conf is restored when ip-down is called
# by pppd when the link goes down.
#
rm -f /etc/ppp/resolv.prev
if [ -f /etc/resolv.conf ]; then
	cp -p /etc/resolv.conf /etc/ppp/resolv.prev
	grep domain /etc/ppp/resolv.prev > /etc/resolv.conf
	grep search /etc/ppp/resolv.prev >> /etc/resolv.conf
	cat /etc/ppp/resolv.conf /etc >> /etc/resolv.conf
else
	cp /etc/ppp/resolv.conf /etc
	chmod 644 /etc/resolv.conf
fi

exit 0

