All pastes #966287 Raw Edit

Someone

public text v1 · immutable
·published 2008-04-01 17:17 UTC
rendered paste body

# Copyright (C) 2006 OpenWrt.org
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
. /etc/diag.sh

failsafe_ip() {
        ifconfig $ifname 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.2
}

failsafe() {
        [ -n "$ifname" ] && grep "$ifname" /proc/net/dev >/dev/null && {
                failsafe_ip
                netmsg 192.168.1.255 "Entering Failsafe!"
                telnetd -l /bin/login <> /dev/null 2>&1
        }
        lock /tmp/.failsafe
        ash --login
}

mount none /proc -t proc
mount none /sys  -t sysfs

size=$(awk '/MemTotal:/ {l=5242880;mt=($2*1024);print((s=mt/2)<l)?mt-l:s}' /proc
- preinit 9/67 13%