Annotation of /trunk/ppp/ip-down
Parent Directory | Revision Log
Revision 303 -
(hide annotations)
(download)
Sat Aug 18 18:50:53 2007 UTC (17 years, 2 months ago) by niro
File size: 947 byte(s)
Sat Aug 18 18:50:53 2007 UTC (17 years, 2 months ago) by niro
File size: 947 byte(s)
-support files for pppd
1 | niro | 303 | #!/bin/sh |
2 | # $Header: /root/magellan-cvs/src/ppp/ip-down,v 1.1 2007-08-18 18:50:53 niro Exp $ | ||
3 | # | ||
4 | # This script is run by pppd when there's a successful ppp connection. | ||
5 | # | ||
6 | |||
7 | # the following parameters are available: | ||
8 | # $1 = interface-name | ||
9 | # $2 = tty-device | ||
10 | # $3 = speed | ||
11 | # $4 = local-IP-address | ||
12 | # $5 = remote-IP-address | ||
13 | # $6 = ipparam | ||
14 | |||
15 | if [[ ${USEPEERDNS} ]] | ||
16 | then | ||
17 | if [ -x /sbin/resolvconf ] | ||
18 | then | ||
19 | resolvconf -d "$1" | ||
20 | else | ||
21 | # taken from debian's 0000usepeerdns | ||
22 | # follow any symlink to find the real file | ||
23 | REALRESOLVCONF=$(readlink --canonicalize /etc/resolv.conf) | ||
24 | |||
25 | if [[ ${REALRESOLVCONF} != /etc/ppp/resolv.conf ]] | ||
26 | then | ||
27 | # if an old resolv.conf file exists, restore it | ||
28 | if [ -e ${REALRESOLVCONF}.pppd-backup ] | ||
29 | then | ||
30 | mv ${REALRESOLVCONF}.pppd-backup ${REALRESOLVCONF} | ||
31 | fi | ||
32 | fi | ||
33 | fi | ||
34 | fi | ||
35 | |||
36 | if [ -f /etc/conf.d/net.$1 ] | ||
37 | then | ||
38 | /etc/rc.d/init.d/network stop $1 > /dev/null | ||
39 | fi | ||
40 | |||
41 | [ -f /etc/ppp/ip-down.local ] && . /etc/ppp/ip-down.local "$@" |