freewrt_1_0
freewrt_2_0
| Line | |
|---|
| 1 | #!/bin/sh
|
|---|
| 2 |
|
|---|
| 3 | ifconfig $failsafe_if 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255 up
|
|---|
| 4 | netmsg 192.168.1.0 "(dummy message)"
|
|---|
| 5 | netmsg 192.168.1.255 "Press reset now, to enter Failsafe!"
|
|---|
| 6 | sleep 2
|
|---|
| 7 |
|
|---|
| 8 | if [ "$(cat /proc/sys/reset 2>&-)" = 1 -o "$(nvram get failsafe)" = 1 ]; then
|
|---|
| 9 | while :; do { echo $(((X=(X+1)%8)%2)) > /proc/sys/diag; sleep $((X==0)); }
|
|---|
| 10 | done &
|
|---|
| 11 | export FAILSAFE=true
|
|---|
| 12 | netmsg 192.168.1.255 "Entering Failsafe!"
|
|---|
| 13 | telnetd -l /bin/login <> /dev/null 2>&1
|
|---|
| 14 | else
|
|---|
| 15 | ifconfig $failsafe_if 0.0.0.0
|
|---|
| 16 | # revert to the boot loader's vlan config
|
|---|
| 17 | # required for at least WRT54G v1.1
|
|---|
| 18 | [ -d /proc/switch/eth0 ] && {
|
|---|
| 19 | echo "$v0p" > /proc/switch/eth0/vlan/0/ports
|
|---|
| 20 | echo "$v1p" > /proc/switch/eth0/vlan/1/ports
|
|---|
| 21 | echo "$v2p" > /proc/switch/eth0/vlan/2/ports
|
|---|
| 22 | }
|
|---|
| 23 | fi
|
|---|
| 24 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.