bcm63xx: Don't hardcode the switch ethernet interface in preinit.
[openwrt/svn-archive/archive.git] / target / linux / brcm63xx / base-files / lib / preinit / 05_failsafe_config_switch_brcm63xx
index b9be96eda6a12906d005b0273e4ddd36fd65df5a..43da8cc0689134f19808c7e968dd7e043f5b21d3 100644 (file)
@@ -1,9 +1,9 @@
 #!/bin/sh
 
 failsafe_ip() {
-       [ -d /proc/switch/eth1 ] && [ "$ifname" = "eth1" ] && {
-               ifconfig eth1 0.0.0.0 down
-               echo "0 1 2 3 4 ${cpu_port:-5u*}" > /proc/switch/eth1/vlan/0/ports
+       [ -d "/proc/switch/$ifname" ] && {
+               ifconfig "$ifname" 0.0.0.0 down
+               echo "0 1 2 3 4 ${cpu_port:-5u*}" > "/proc/switch/$ifname/vlan/0/ports"
        }
        
        [ -n "$pi_ifname" ] && grep -q "$pi_ifname" /proc/net/dev && {