Line 0
Link Here
|
|
|
1 |
#!/bin/bash |
2 |
|
3 |
# Check if interface up by etcnet. In this case "$6" must |
4 |
# be set as "etcnet-$NAME" due to pppd ipparam option |
5 |
# when interface was created |
6 |
|
7 |
NAME="$1" |
8 |
IPPARAM="$6" |
9 |
|
10 |
test "$IPPARAM" = "etcnet-$NAME" || exit |
11 |
|
12 |
. ${SCRIPTDIR:=/etc/net/scripts}/functions |
13 |
if [ -d $IFACEDIR/$NAME@$NETHOST ]; then |
14 |
MYIFACEDIR=$IFACEDIR/$NAME@$NETHOST |
15 |
else |
16 |
MYIFACEDIR=$IFACEDIR/$NAME |
17 |
fi |
18 |
|
19 |
[ -d "$MYIFACEDIR" ] || exit |
20 |
export IFACEDIR MYIFACEDIR SCRIPTDIR NAME NETPROFILE SEEN_IFACES |
21 |
|
22 |
# Check if ifup script is in progress. If true then ifup |
23 |
# do all itself, so we exit |
24 |
|
25 |
IFACE_LOCK_FILE="${VARLOCKDIR:=var/lock/etcnet}/if-updown-$NAME.lock" |
26 |
test -f "$IFACE_LOCK_FLE" && exit |
27 |
|
28 |
# At this point we are sure that interface is up by etcnet system |
29 |
# and this script is called by pppd after ifup was completed |
30 |
# (e.g. when reconnected due to persist option) |
31 |
|
32 |
# Reconfiguring iface and routes |
33 |
ExecIfExecutable ${SCRIPTDIR}/ifconfig-ipv4 $NAME |
34 |
|
35 |
# Call custom scripts |
36 |
ExecIfExecutable ${SCRIPTDIR}/ifup-post-local $NAME |
37 |
ExecIfExecutable ${MYIFACEDIR}/ifup-post $NAME |
38 |
|