]>
Commit | Line | Data |
---|---|---|
12de71be | 1 | #!/bin/sh |
b0443108 | 2 | # |
8192b17e | 3 | # $Id: ifup-post,v 1.22 2000/11/16 15:58:55 baggins Exp $ |
b0443108 | 4 | # |
7742e157 | 5 | |
201c98b9 AM |
6 | run_up() { :; } |
7 | ||
dd4a755f | 8 | . /etc/rc.d/init.d/functions |
f3002e12 | 9 | . /etc/sysconfig/network |
8b3e2b71 | 10 | . /etc/sysconfig/network-scripts/.functions |
7742e157 AF |
11 | |
12 | need_hostname | |
12de71be | 13 | CONFIG=$1 |
7742e157 AF |
14 | source_config |
15 | ||
97c76ad5 | 16 | # full device name as specified by user |
38198f50 | 17 | FULLDEVNAME="$DEVICE" |
8192b17e JR |
18 | # detect network device type (ie. dummy, eth for dummy0, eth0 ..) |
19 | DEVICETYPE=$(echo $DEVICE | awk ' { gsub(/[0-9]*$/,NUL); print $0 } ') | |
20 | # real name of device (ie. is eth0 for eth0,eth0:1,eth0:alias) | |
21 | DEVICE=$(echo $DEVICE | awk ' { gsub(/:.*$/,NUL); print $0 } ') | |
38198f50 | 22 | |
919bed72 JK |
23 | get_ppp_device_and_pid |
24 | ||
38198f50 | 25 | if echo "$FULLDEVNAME" | grep -q ':' ; then |
e4cc7085 | 26 | ISALIAS=yes |
7742e157 | 27 | else |
e4cc7085 | 28 | ISALIAS=no |
7742e157 AF |
29 | fi |
30 | ||
919bed72 JK |
31 | # Set the queuing discipline |
32 | # eg: sfq for better link sharing or teql0 for link equalizer | |
33 | if [ -n "$QDISC" ] ; then | |
34 | tc qdisc add dev "$REALDEVICE" root $QDISC | |
35 | fi | |
36 | ||
979e6977 | 37 | /etc/sysconfig/network-scripts/ifup-routes ${CONFIG} |
7742e157 | 38 | |
830949ca | 39 | if [ "$ISALIAS" = "no" ] ; then |
e4cc7085 | 40 | /etc/sysconfig/network-scripts/ifup-aliases ${DEVICE} |
7742e157 AF |
41 | fi |
42 | ||
d29c401a AM |
43 | # don't set hostname on ppp/slip connections |
44 | if [ -n "$NEEDHOSTNAME" -a "${DEVICE}" != lo -a "${DEVICETYPE}" != "ppp" -a "${DEVICETYPE}" != "slip" ]; then | |
1381691b | 45 | IPADDR=`ip -f inet addr show dev ${DEVICE} label ${FULLDEVNAME} | |
6588d0a8 | 46 | awk '/inet/ { print $2 }' |awk -F"/" '{ print $1 }'` |
e4cc7085 | 47 | eval `/bin/ipcalc --silent --hostname ${IPADDR}` && set_hostname $HOSTNAME |
7742e157 AF |
48 | fi |
49 | ||
201c98b9 AM |
50 | # execute run_up() function (if available in device configuration file) |
51 | [ "$ISALIAS" = "no" ] && run_up | |
97c76ad5 | 52 | |
7742e157 AF |
53 | # Notify programs that have requested notification |
54 | do_netreport | |
55 | ||
56 | exit 0 |