Annotation of /trunk/ppp/ip-downd-40-dns.sh
Parent Directory | Revision Log
Revision 1105 -
(hide annotations)
(download)
(as text)
Fri Aug 20 10:27:56 2010 UTC (14 years, 1 month ago) by niro
File MIME type: application/x-sh
File size: 628 byte(s)
Fri Aug 20 10:27:56 2010 UTC (14 years, 1 month ago) by niro
File MIME type: application/x-sh
File size: 628 byte(s)
-be busybox comaptible
1 | niro | 796 | #!/bin/sh |
2 | |||
3 | # Restore DNS resolver settings | ||
4 | # Used parameters and environment variables: | ||
5 | # $1 - interface name (e.g. ppp0) | ||
6 | # $USEPEERDNS - set if user specified usepeerdns | ||
7 | |||
8 | if [ "$USEPEERDNS" ]; then | ||
9 | if [ -x /sbin/resolvconf ]; then | ||
10 | /sbin/resolvconf -d "$1" | ||
11 | else | ||
12 | # taken from debian's 0000usepeerdns | ||
13 | # follow any symlink to find the real file | ||
14 | niro | 1105 | REALRESOLVCONF=$(readlink -f /etc/resolv.conf) |
15 | niro | 796 | |
16 | if [ "$REALRESOLVCONF" != "/etc/ppp/resolv.conf" ]; then | ||
17 | |||
18 | # if an old resolv.conf file exists, restore it | ||
19 | if [ -e $REALRESOLVCONF.pppd-backup ]; then | ||
20 | mv $REALRESOLVCONF.pppd-backup $REALRESOLVCONF | ||
21 | fi | ||
22 | |||
23 | fi | ||
24 | fi | ||
25 | fi |