let ipkg fail when a package file to be installed is not found
[openwrt/staging/wigyori.git] / openwrt / target / linux / package / base-files / files / brcm-2.4 / etc / hotplug.d / net / 09-net
1 #!/bin/sh
2 setup_wl()
3 {
4 [ -f /proc/net/wl0 ] && {
5 lsmod | grep wlcompat >&- || insmod wlcompat
6 }
7 iwconfig "$INTERFACE" 2>&- | grep -v 'no wireless' >&- && {
8 /sbin/wifi
9 }
10 }
11 setup_eth()
12 {
13 [ -d /proc/switch ] || {
14 insmod switch-core
15 insmod switch-robo || insmod switch-adm
16 }
17 if="$(echo "$INTERFACE" | sed s,eth,et,)"
18 ifconfig "$INTERFACE" up 2>&- >&-
19 [ -d "/proc/switch/$INTERFACE" ] || return 0
20 echo "1" > "/proc/switch/$INTERFACE/reset"
21 echo "1" > "/proc/switch/$INTERFACE/enable_vlan"
22 for vlan in $(seq 0 15); do
23 eval "hwname=\"\${vlan${vlan}hwname}\""
24 [ "$hwname" = "$if" ] && {
25 eval "vports=\"\${vlan${vlan}ports}\""
26 [ -n "$vports" ] && echo "$vports" > "/proc/switch/$INTERFACE/vlan/$vlan/ports"
27 $DEBUG vconfig add "$INTERFACE" "$vlan"
28 }
29 done
30 }
31
32 do_register()
33 {
34 case "${INTERFACE%%[0-9]*}" in
35 eth) setup_eth;;
36 wl) setup_wl;;
37 esac
38 }
39
40
41 case "$ACTION" in
42 add|register) do_register;;
43 esac