-failsafe_ip() {
- ifconfig $ifname 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255 up
-}
-
-failsafe() {
- set_state failsafe
- [ -n "$ifname" ] && grep "$ifname" /proc/net/dev >/dev/null && {
- failsafe_ip
- netmsg 192.168.1.255 "Entering Failsafe!"
- telnetd -l /bin/login.sh <> /dev/null 2>&1
- }
- lock /tmp/.failsafe
- ash --login
-}
-
-mount proc /proc -t proc
-mount sysfs /sys -t sysfs
-
-size=$(awk '/MemTotal:/ {l=5242880;mt=($2*1024);print((s=mt/2)<l)&&(mt>l)?mt-l:s}' /proc/meminfo)
-mount tmpfs /tmp -t tmpfs -o size=$size,nosuid,nodev,mode=1777