3 # Kernel NET hotplug params include:
5 # ACTION=%s [register or unregister]
8 . /etc/sysconfig/network-scripts/functions.network
11 /usr/bin/logger -t $(basename $0)"[$$]" "$@"
18 # returns true if device is either wireless, usbnet or is named eth* and supports ethtool
20 [ -d /sys/class/net/$1/wireless/ ] && return 0
21 [[ "$1" == bnep* ]] && return 0
22 # eagle-usb/firewire create a fake ethX interface
23 if [ -x /usr/sbin/ethtool ] && ! /usr/sbin/ethtool $1 > /dev/null 2>&1;
29 if [ "$INTERFACE" = "" ]; then
30 mesg Bad NET invocation: \$INTERFACE is not set
39 # interfaces that are registered after being "up" (?)
40 ppp*|ippp*|isdn*|plip*|lo*|irda*|dummy*|ipsec*|tun*|tap*)
41 debug_mesg assuming $INTERFACE is already up
44 # interfaces that are registered then brought up
46 # NOTE: network configuration relies on administered state,
47 # we can't do much here without distro-specific knowledge
48 # such as whether/how to invoke DHCP, set up bridging, etc.
50 # Run nameif as needed - Jean II
51 # Remap interface names based on MAC address. This workaround
52 # the dreaded configuration problem "all my cards are 'eth0'"...
53 # This needs to be done before ifup otherwise ifup will get
54 # confused by the name changed and because iface need to be
55 # down to change its name.
56 if [ -x /sbin/nameif ] && [ -r /etc/mactab ]; then
57 debug_mesg invoke nameif for $INTERFACE
58 NEWNAME=`/sbin/nameif`
61 # conform to network service (AUTOMATIC_IFCFG)
62 [ -r /etc/sysconfig/network ] && . /etc/sysconfig/network
64 # don't do anything for non ethernet devices
65 ethernet_check $INTERFACE || exit 0;
67 # automatically create an interface file
68 CFG=/etc/sysconfig/network-scripts/ifcfg-$INTERFACE
69 if [ "$AUTOMATIC_IFCFG" != no -a ! -r $CFG ]; then
70 debug_mesg creating config file for $INTERFACE
78 if [ ! -f /var/lock/subsys/network ] || [ ! -r $CFG ]; then
79 # Don't do anything if the network is stopped or interface isn't configured
83 if [ -x /sbin/ifup ]; then
84 debug_mesg invoke ifup $INTERFACE
85 exec /sbin/ifup $INTERFACE hotplug
89 mesg $1 $ACTION event not handled
94 # interfaces that are unregistered after being "down" (?)
95 ppp*|ippp*|isdn*|plip*|lo*|irda*|dummy*|ipsec*|tun*|tap*)
96 debug_mesg assuming $INTERFACE is already down
100 if [ -x /sbin/ifdown ]; then
101 debug_mesg invoke ifdown $INTERFACE
102 exec /sbin/ifdown $INTERFACE daemon
106 mesg $1 $ACTION event not handled
110 debug_mesg NET $ACTION event for $INTERFACE not supported