File: ip-up.local.add

package info (click to toggle)
ppp 2.4.7-2+4.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 7,100 kB
  • sloc: ansic: 56,241; sh: 1,050; perl: 334; makefile: 114; exp: 82
file content (24 lines) | stat: -rw-r--r-- 729 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

#
# This sample code shows you one way to modify your setup to allow automatic
# configuration of your resolv.conf for peer supplied DNS addresses when using
# the `usepeerdns' option.
#
# In my case I just added this to my /etc/ppp/ip-up.local script. You may need to 
# create an executable script if one does not exist.
#
# Nick Walker (nickwalker@email.com)
#

if [ -n "$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then
	rm -f /etc/ppp/resolv.prev
	if [ -f /etc/resolv.conf ]; then
		cp /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/resolv.conf
	else
		cp /etc/ppp/resolv.conf /etc
	fi
fi