]> git.pld-linux.org Git - projects/rc-scripts.git/blame - ppp/ip-down
- proper CONFIG sources (needed to override DEVICE from pppd and get
[projects/rc-scripts.git] / ppp / ip-down
CommitLineData
b87efb1f 1#!/bin/sh
b0443108 2#
ec8b15cb 3# $Id$
7742e157
AF
4# This file should not be modified
5#
6# This script is run by the pppd _after_ the link is brought down.
7742e157
AF
7#
8# This script is called with the following arguments:
5e6dfc29
JR
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
7742e157 16
763b88c2
AM
17set +e
18
5e6dfc29 19# The environment is cleared before executing this script
7742e157
AF
20# so the path must be reset
21PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin
22export PATH
23# These variables are for the use of the scripts run by run-parts
24PPP_IFACE="$1"
25PPP_TTY="$2"
26PPP_SPEED="$3"
27PPP_LOCAL="$4"
28PPP_REMOTE="$5"
29PPP_IPPARAM="$6"
30export PPP_IFACE PPP_TTY PPP_SPEED PPP_LOCAL PPP_REMOTE PPP_IPPARAM
31
763b88c2 32. /etc/rc.d/init.d/functions
5e6dfc29 33. /etc/sysconfig/network-scripts/functions.network
635385ab 34CONFIG="/etc/sysconfig/interfaces/ifcfg-$PPP_IPPARAM"
eb4dd2c6
JK
35source_config
36
7742e157
AF
37# as an additional convienince, $PPP_TTYNAME is set to the tty name,
38# stripped of /dev/ (if present) for easier matching.
763b88c2 39PPP_TTYNAME=$(basename "$PPP_TTY")
7742e157
AF
40export PPP_TTYNAME
41
7742e157 42# Main Script starts here
763b88c2 43[ -x /etc/ppp/ip-down.local ] && /etc/ppp/ip-down.local
7742e157 44
dd4a755f 45run-parts /etc/sysconfig/interfaces/down.d/ppp
7742e157 46
eb4dd2c6 47/etc/sysconfig/network-scripts/ifdown-post "${CONFIG}"
7742e157
AF
48
49exit 0
This page took 1.705325 seconds and 4 git commands to generate.