source: freewrt/package/base-files/default/sbin/failsafe@ e4ba301

freewrt_1_0 freewrt_2_0
Last change on this file since e4ba301 was e4ba301, checked in by Waldemar Brodkorb <wbx@…>, 19 years ago
  • add a specific preinit.arch which executes brcm specific stuff
  • for squashfs based images, use mini_fo as default, no ugly symlinks anymore
  • add a "version" command, which can be used later, to exactly know which FreeWRT version is used (good for postinst scripts and bugreports), some users like to recreate the shell banner, but still need to know which version is used
  • remove nvram sepcific stuff from some of the startup scripts, like syslogd startup params
  • add some checks if ldd / arp is installed in /etc/profile

git-svn-id: svn://www.freewrt.org/trunk/freewrt@182 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100644
File size: 768 bytes
Line 
1#!/bin/sh
2
3ifconfig $failsafe_if 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255 up
4netmsg 192.168.1.0 "(dummy message)"
5netmsg 192.168.1.255 "Press reset now, to enter Failsafe!"
6sleep 2
7
8if [ "$(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)); }
10done &
11 export FAILSAFE=true
12 netmsg 192.168.1.255 "Entering Failsafe!"
13 telnetd -l /bin/login <> /dev/null 2>&1
14else
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 }
23fi
24
Note: See TracBrowser for help on using the repository browser.