]> git.pld-linux.org Git - projects/rc-scripts.git/blame - sysconfig/network-scripts/ifup-post
added abilities for setup static RARP table by
[projects/rc-scripts.git] / sysconfig / network-scripts / ifup-post
CommitLineData
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
6run_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
12need_hostname
12de71be 13CONFIG=$1
7742e157
AF
14source_config
15
97c76ad5 16# full device name as specified by user
38198f50 17FULLDEVNAME="$DEVICE"
8192b17e
JR
18# detect network device type (ie. dummy, eth for dummy0, eth0 ..)
19DEVICETYPE=$(echo $DEVICE | awk ' { gsub(/[0-9]*$/,NUL); print $0 } ')
20# real name of device (ie. is eth0 for eth0,eth0:1,eth0:alias)
21DEVICE=$(echo $DEVICE | awk ' { gsub(/:.*$/,NUL); print $0 } ')
38198f50 22
919bed72
JK
23get_ppp_device_and_pid
24
38198f50 25if echo "$FULLDEVNAME" | grep -q ':' ; then
e4cc7085 26 ISALIAS=yes
7742e157 27else
e4cc7085 28 ISALIAS=no
7742e157
AF
29fi
30
919bed72
JK
31# Set the queuing discipline
32# eg: sfq for better link sharing or teql0 for link equalizer
33if [ -n "$QDISC" ] ; then
34 tc qdisc add dev "$REALDEVICE" root $QDISC
35fi
36
979e6977 37/etc/sysconfig/network-scripts/ifup-routes ${CONFIG}
7742e157 38
830949ca 39if [ "$ISALIAS" = "no" ] ; then
e4cc7085 40 /etc/sysconfig/network-scripts/ifup-aliases ${DEVICE}
7742e157
AF
41fi
42
d29c401a
AM
43# don't set hostname on ppp/slip connections
44if [ -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
48fi
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
54do_netreport
55
56exit 0
This page took 0.076458 seconds and 4 git commands to generate.