kfurge
08-03-2007, 03:34
I'm sure I'm not the only person who has messed up his rc.local file resulting in a brain-dead router. When this happens, the only way out has been to reflash the original Asus firmware, install the telnet hack, fix the rc.local file, reload the custom firmware, and continue where I left off 1/2 hour earler.
To rectify that, I now start the telnet server at the very beginning of rc.local then check to see if the copy button is pressed. If so, I immediately exit rc.local. The top of my rc.local file now looks like:
#!/bin/sh
# Always start utelnetd on local interface
if [ ! -f /var/run/utelnetd.pid ]; then
/apps/bin/utelnetd -d -i br0
/bin/echo "unknown" > /var/run/utelnetd.pid
fi
# If the copy button is pressed, bypass rc.local
bypass=`/bin/cat /proc/miscio/gpio_6`
if test $bypass -eq "1"; then
exit -1
fi
To activate the bypass, just press and hold the copy button during the boot sequence. You can then telnet in to fix whatever was wrong.
- K.C.
To rectify that, I now start the telnet server at the very beginning of rc.local then check to see if the copy button is pressed. If so, I immediately exit rc.local. The top of my rc.local file now looks like:
#!/bin/sh
# Always start utelnetd on local interface
if [ ! -f /var/run/utelnetd.pid ]; then
/apps/bin/utelnetd -d -i br0
/bin/echo "unknown" > /var/run/utelnetd.pid
fi
# If the copy button is pressed, bypass rc.local
bypass=`/bin/cat /proc/miscio/gpio_6`
if test $bypass -eq "1"; then
exit -1
fi
To activate the bypass, just press and hold the copy button during the boot sequence. You can then telnet in to fix whatever was wrong.
- K.C.