]>
Commit | Line | Data |
---|---|---|
12de71be | 1 | #!/bin/sh |
b0443108 | 2 | # |
97c76ad5 | 3 | # $Id: ifup-post,v 1.16 2000/03/08 16:30:14 misiek Exp $ |
b0443108 | 4 | # |
7742e157 | 5 | |
f3002e12 | 6 | . /etc/sysconfig/network |
8b3e2b71 | 7 | . /etc/sysconfig/network-scripts/.functions |
7742e157 AF |
8 | |
9 | need_hostname | |
12de71be | 10 | CONFIG=$1 |
7742e157 AF |
11 | source_config |
12 | ||
97c76ad5 | 13 | # full device name as specified by user |
38198f50 | 14 | FULLDEVNAME="$DEVICE" |
97c76ad5 | 15 | # type of device for example "dummy" or "eth" |
38198f50 | 16 | DEVICETYPE=`echo $FULLDEVNAME | sed "s/[0-9]*$//"` |
97c76ad5 | 17 | # name of real device ie. eth0 when eth0,eth0:1,eth0:alias |
38198f50 AM |
18 | DEVICE=`echo $FULLDEVNAME | sed 's/:.*//g'` |
19 | ||
20 | if echo "$FULLDEVNAME" | grep -q ':' ; then | |
e4cc7085 | 21 | ISALIAS=yes |
7742e157 | 22 | else |
e4cc7085 | 23 | ISALIAS=no |
7742e157 AF |
24 | fi |
25 | ||
ea04cbe6 | 26 | /etc/sysconfig/network-scripts/ifup-routes ${FULLDEVNAME} |
7742e157 | 27 | |
830949ca | 28 | if [ "$ISALIAS" = "no" ] ; then |
e4cc7085 | 29 | /etc/sysconfig/network-scripts/ifup-aliases ${DEVICE} |
7742e157 AF |
30 | fi |
31 | ||
d29c401a AM |
32 | # don't set hostname on ppp/slip connections |
33 | if [ -n "$NEEDHOSTNAME" -a "${DEVICE}" != lo -a "${DEVICETYPE}" != "ppp" -a "${DEVICETYPE}" != "slip" ]; then | |
1381691b | 34 | IPADDR=`ip -f inet addr show dev ${DEVICE} label ${FULLDEVNAME} | |
e4cc7085 | 35 | awk '{ print $2 }' |awk -F"/" '{ print $1 }'` |
36 | eval `/bin/ipcalc --silent --hostname ${IPADDR}` && set_hostname $HOSTNAME | |
7742e157 AF |
37 | fi |
38 | ||
97c76ad5 AM |
39 | # run scripts in /etc/sysconfig/interfaces/scripts/$DEVICE/ |
40 | # named somename.up | |
41 | rparts "/etc/sysconfig/interfaces/scripts/$DEVICE" start | |
42 | ||
7742e157 AF |
43 | # Notify programs that have requested notification |
44 | do_netreport | |
45 | ||
46 | exit 0 |