rename default/ to files/
[openwrt/openwrt.git] / package / base-files / files / etc / hotplug.d / net / 10-net
1 # Copyright (C) 2006 OpenWrt.org
2
3 include /lib/network
4
5 addif() {
6 scan_interfaces
7 local cfg="$(find_config "$INTERFACE")"
8
9 # check the autoload setting
10 config_get auto "$cfg" auto
11 case "$auto" in
12 1|on|enabled) setup_interface "$INTERFACE";;
13 esac
14
15
16 # find all vlan configurations for this interface and set them up as well
17 for ifc in $interfaces; do
18 config_get iftype "$ifc" type
19 config_get ifs "$ifc" device
20 for dev in $ifs; do
21 [ "${dev%%\.*}" = "$INTERFACE" -a "$dev" != "$INTERFACE" ] && {
22 add_vlan "$dev"
23 }
24 done
25 done
26 }
27
28 case "$ACTION" in
29 add|register)
30 case "$PHYSDEVDRIVER" in
31 natsemi) sleep 1;;
32 esac
33 addif
34 ;;
35 esac