source: projects/initscripts/tags/initscripts-8.91.0/sysconfig/network-scripts/net.hotplug @ 1108

Revision 1108, 1.1 KB checked in by daisuke, 14 years ago (diff)

import initscripts-8.90.6 from internal cvs repository

Line 
1#!/bin/sh
2
3. /etc/sysconfig/network-scripts/network-functions
4
5if [ "$INTERFACE" = "" ]; then
6    exit 1
7fi
8
9case $ACTION in
10add|register)
11    # Don't do anything if the network is stopped
12    if [ -f /dev/.in_sysinit ] ; then
13        exit 0
14    fi
15    if [ ! -f /var/lock/subsys/network ]; then
16        exit 0
17    fi
18   
19    case $INTERFACE in
20        # interfaces that are brought up as a part of configuration
21        ppp*|ippp*|isdn*|plip*|lo*|irda*|dummy*|ipsec*|tun*|tap*)
22            exit 0
23            ;;
24        # interfaces that are registered then brought up
25        *)
26            export IN_HOTPLUG=1
27            if [ -x /sbin/ifup ]; then
28                addr=$(get_hwaddr ${INTERFACE})
29                if [ -n "$addr" ]; then
30                        nconfig=$(get_config_by_hwaddr ${addr})
31                        [ -n "$nconfig" ] && INTERFACE=$nconfig
32                fi
33                exec /sbin/ifup $INTERFACE
34            fi 
35            ;;
36    esac
37    ;;
38
39remove|unregister)
40    case $INTERFACE in
41        # interfaces that are brought down as part of deconfiguration
42        ppp*|ippp*|isdn*|plip*|lo*|irda*|dummy*|ipsec*|tun*|tap*)
43            exit 0
44            ;;
45        *)
46            export IN_HOTPLUG=1
47            if [ -x /sbin/ifdown ]; then
48                exec /sbin/ifdown $INTERFACE
49            fi
50            ;;
51    esac
52    ;;
53
54*)
55    exit 1 ;;
56
57esac
Note: See TracBrowser for help on using the repository browser.