]>
Commit | Line | Data |
---|---|---|
b87efb1f | 1 | #!/bin/sh |
b0443108 | 2 | # |
8dbd5412 | 3 | # $Id: ip-down,v 1.5 2000/05/07 19:00:00 siefca Exp $ |
7742e157 AF |
4 | # This file should not be modified |
5 | # | |
6 | # This script is run by the pppd _after_ the link is brought down. | |
7 | # It uses run-parts to run scripts in /etc/ppp/ip-down.d, so to delete | |
8 | # routes, unset IP addresses etc. you should create script(s) there. | |
9 | # | |
10 | # Be aware that other packages may include /etc/ppp/ip-down.d scripts (named | |
11 | # after that package), so choose local script names with that in mind. | |
12 | # | |
13 | # This script is called with the following arguments: | |
14 | # Arg Name Example | |
15 | # $1 Interface name ppp0 | |
16 | # $2 The tty ttyS1 | |
17 | # $3 The link speed 38400 | |
18 | # $4 Local IP number 12.34.56.78 | |
19 | # $5 Peer IP number 12.34.56.99 | |
20 | # $6 Optional ``ipparam'' value foo | |
21 | ||
22 | # The environment is cleared before executing this script | |
23 | # so the path must be reset | |
24 | PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin | |
25 | export PATH | |
26 | # These variables are for the use of the scripts run by run-parts | |
27 | PPP_IFACE="$1" | |
28 | PPP_TTY="$2" | |
29 | PPP_SPEED="$3" | |
30 | PPP_LOCAL="$4" | |
31 | PPP_REMOTE="$5" | |
32 | PPP_IPPARAM="$6" | |
33 | export PPP_IFACE PPP_TTY PPP_SPEED PPP_LOCAL PPP_REMOTE PPP_IPPARAM | |
34 | ||
eb4dd2c6 JK |
35 | . /etc/sysconfig/network-scripts/.functions |
36 | CONFIG="$PPP_IPPARAM" | |
37 | source_config | |
38 | ||
7742e157 AF |
39 | # as an additional convienince, $PPP_TTYNAME is set to the tty name, |
40 | # stripped of /dev/ (if present) for easier matching. | |
eb4dd2c6 | 41 | PPP_TTYNAME=`/usr/bin/basename "$PPP_TTY"` |
7742e157 AF |
42 | export PPP_TTYNAME |
43 | ||
7742e157 AF |
44 | # Main Script starts here |
45 | ||
8dbd5412 | 46 | run-parts /etc/sysconfig/interfaces/down.d |
7742e157 | 47 | |
eb4dd2c6 | 48 | /etc/sysconfig/network-scripts/ifdown-post "${CONFIG}" |
7742e157 AF |
49 | |
50 | exit 0 |