summaryrefslogtreecommitdiff
blob: 20d2b99193c9568419947ef685b347d6802d9b12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh

# this is a script which is executed after connecting the ppp interface.
# look at man pppd for details

# the followings parameters are available:
# $1 = interface-name
# $2 = tty-device
# $3 = speed
# $4 = local-IP-address
# $5 = remote-IP-address
# $6 = ipparam

if [ "$USEPEERDNS" ]; then

	# add the server supplied DNS entries to /etc/resolv.conf
	# (taken from debian's 0000usepeerdns)

	# follow any symlink to find the real file
	REALRESOLVCONF=$(readlink --canonicalize /etc/resolv.conf)

	if [ "$REALRESOLVCONF" != "/etc/ppp/resolv.conf" ]; then

	# merge the new nameservers with the other options from the old configuration
	{
		grep --invert-match '^nameserver[[:space:]]' $REALRESOLVCONF
		cat /etc/ppp/resolv.conf
	} > $REALRESOLVCONF.tmp

	# backup the old configuration and install the new one
	cp -a $REALRESOLVCONF $REALRESOLVCONF.pppd-backup
	mv $REALRESOLVCONF.tmp $REALRESOLVCONF

	fi

fi

[ -f /etc/init.d/firewall ] && /etc/init.d/firewall start

[ -f /etc/ppp/ip-up.local ] && . /etc/ppp/ip-up.local $1 $2 $3 $4 $5 $6