From 7ce066eddc94aa7be0bd4e532c1a5dfb75ebd23b Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 18 Mar 2006 09:16:56 +0000 Subject: [PATCH] fix failsafe for wap54g, wl-500g, wl-hdd, etc. (#292, #356) SVN-Revision: 3397 --- openwrt/package/base-files/default/etc/preinit | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/openwrt/package/base-files/default/etc/preinit b/openwrt/package/base-files/default/etc/preinit index dd481e065d..4b57799d0c 100755 --- a/openwrt/package/base-files/default/etc/preinit +++ b/openwrt/package/base-files/default/etc/preinit @@ -5,6 +5,12 @@ mount none /proc -t proc insmod diag echo 0x01 > /proc/sys/diag +ifname=eth0 +# WAP54G, WL-HDD +[ "$(nvram get boardnum)" = "2" \ +-o \( "$(nvram get boardnum)" = "asusX" \ + -a "$(nvram get et1phyaddr)" -eq 1 \) ] && ifname="eth1" + insmod switch-core insmod switch-robo || insmod switch-adm || rmmod switch-core @@ -22,7 +28,7 @@ insmod switch-robo || insmod switch-adm || rmmod switch-core esac > /proc/switch/eth0/vlan/0/ports } -ifconfig eth0 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255 up +ifconfig $ifname 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255 up netmsg 192.168.1.0 "(dummy message)" # b44 eats the first packet netmsg 192.168.1.255 "Press reset now, to enter Failsafe!" @@ -36,9 +42,9 @@ if [ $(cat /proc/sys/reset) = 1 -o "$(nvram get failsafe)" = 1 ]; then nvram commit } netmsg 192.168.1.255 "Entering Failsafe!" - telnetd -l /bin/login + telnetd -l /bin/login <> /dev/null 2>&1 else - ifconfig eth0 0.0.0.0 + ifconfig $ifname 0.0.0.0 # revert to the boot loader's vlan config # required for at least WRT54G v1.1 -- 2.30.2