]> git.pld-linux.org Git - projects/rc-scripts.git/blob - ppp/ip-up
massive :$
[projects/rc-scripts.git] / ppp / ip-up
1 #!/bin/bash
2 #
3 # $Id: ip-up,v 1.2 1999/07/13 12:49:35 misiek Exp $
4 # This file should not be modified
5 #
6 # This script is run by the pppd after the link is established.
7 # It uses run-parts to run scripts in /etc/ppp/ip-up.d, so to add routes,
8 # set IP address, run the mailq etc. you should create script(s) there.
9 #
10 # Be aware that other packages may include /etc/ppp/ip-up.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
35
36 # as an additional convenience, $PPP_TTYNAME is set to the tty name,
37 # stripped of /dev/ (if present) for easier matching.
38 PPP_TTYNAME=`/usr/bin/basename "$2"`
39 export PPP_TTYNAME
40
41 LOGDEVICE=$6
42 REALDEVICE=$1
43
44 echo "$REALDEVICE" > /var/run/ppp-$LOGDEVICE.dev
45
46 # Main Script starts here
47 run-parts /etc/ppp/ip-up.d
48
49 /etc/sysconfig/network-scripts/ifup-post ifcfg-${LOGDEVICE}
50
51 exit 0
This page took 0.025897 seconds and 3 git commands to generate.