]> git.pld-linux.org Git - projects/rc-scripts.git/blob - ppp/ip-down
b52e49c968cf36e741bde4eccaa55291b3aa82e0
[projects/rc-scripts.git] / ppp / ip-down
1 #!/bin/sh
2 #
3 # $Id$
4 # This file should not be modified
5 #
6 # This script is run by the pppd _after_ the link is brought down.
7 #
8 # This script is called with the following arguments:
9 #       Arg     Name                            Example
10 #       $1      Interface name                  ppp0
11 #       $2      The tty                         ttyS1
12 #       $3      The link speed                  38400
13 #       $4      Local IP number                 12.34.56.78
14 #       $5      Peer IP number                  12.34.56.99
15 #       $6      Optional ``ipparam'' value      foo
16
17 set +e
18
19 # The environment is cleared before executing this script
20 # so the path must be reset
21 PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin
22 export PATH
23 # These variables are for the use of the scripts run by run-parts
24 PPP_IFACE="$1"
25 PPP_TTY="$2"
26 PPP_SPEED="$3"
27 PPP_LOCAL="$4"
28 PPP_REMOTE="$5"
29 PPP_IPPARAM="$6"
30 export PPP_IFACE PPP_TTY PPP_SPEED PPP_LOCAL PPP_REMOTE PPP_IPPARAM
31
32 . /etc/rc.d/init.d/functions
33 . /lib/rc-scripts/functions.network
34 CONFIG="/etc/sysconfig/interfaces/ifcfg-$PPP_IPPARAM"
35 source_config
36
37 # as an additional convienince, $PPP_TTYNAME is set to the tty name,
38 # stripped of /dev/ (if present) for easier matching.
39 PPP_TTYNAME=$(basename "$PPP_TTY")
40 export PPP_TTYNAME
41
42 # Main Script starts here
43 [ -x /etc/ppp/ip-down.local ] && /etc/ppp/ip-down.local
44
45 run-parts /etc/sysconfig/interfaces/down.d/ppp
46
47 /lib/rc-scripts/ifdown-post "${CONFIG}"
48
49 exit 0
This page took 0.070835 seconds and 2 git commands to generate.