Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 0c0774ac2c413cef3a2dc2d0db236961 > files > 91

initscripts-9.30.1-1.fc15.i686.rpm

#!/bin/sh

# Don't do anything if the network is stopped
if [ ! -f /var/lock/subsys/network ]; then
    exit 0
fi
if [ -f /dev/.in_sysinit ] ; then
    exit 0
fi

. /etc/sysconfig/network-scripts/network-functions

if [ "$INTERFACE" = "" ]; then
    exit 1
fi

[ "$(cat /sys/class/net/$INTERFACE/type)" != "1" ] && exit 0

case $ACTION in
add|register)
    
    case $INTERFACE in
	# interfaces that are brought up as a part of configuration
	ppp*|ippp*|isdn*|plip*|lo*|irda*|dummy*|ipsec*|tun*|tap*)
	    exit 0
	    ;;
	# interfaces that are registered then brought up
	*)
	    export IN_HOTPLUG=1
	    if [ -x /sbin/ifup ]; then
	        addr=$(get_hwaddr ${INTERFACE})
		if [ -n "$addr" ]; then
			nconfig=$(get_config_by_hwaddr ${addr})
			[ -n "$nconfig" ] && INTERFACE=$nconfig
		fi
		exec /sbin/ifup $INTERFACE
	    fi	
	    ;;
    esac
    ;;

remove|unregister)
    case $INTERFACE in
	# interfaces that are brought down as part of deconfiguration
	ppp*|ippp*|isdn*|plip*|lo*|irda*|dummy*|ipsec*|tun*|tap*)
	    exit 0
	    ;;
	*)
	    export IN_HOTPLUG=1
	    if [ -x /sbin/ifdown ]; then
		exec /sbin/ifdown $INTERFACE
	    fi
	    ;;
    esac
    ;;

*)
    exit 1 ;;

esac