#!/bin/sh
export PATH=$PATH:/usr/bin/scripts
export LD_LIBRARY_PATH=/ram/lib:/lib:/lib/iptables

mount -t usbfs none /proc/bus/usb
mount -t sysfs none /sys

while [ ! -f /tmp/csman/pre4.dat ]
do
	cp -a /usr/mv2ram/* /ram	
done

#hostname
cp /etc/hostname /proc/sys/kernel/hostname

#start network
cat /proc/net/dev
ifconfig eth2 up
ifconfig lo up
vconfig add eth2 1
vconfig add eth2 2
#ifconfig eth2.2 up

# insert usb module
# usb 1.1
# modprobe dwc_otg speed=1
# usb 2.0
modprobe dwc_otg
modprobe rt_timer
# insert modules for iptables
insmod /lib/xt_time.ko

#conntrack_max
echo 20480 > /proc/sys/net/nf_conntrack_max 

# for 3G modem
mkdir -p /var/dev
mkdir -p /var/lock
mkdir -p /var/config

syslogd
klogd -f
getpsec -f 0x3FE000 /tmp/csman/pre1.dat
#logger -p 888.0 -t fc "+"

if [ ! -f /usr/www/index.htm ]; then
	echo "Mount D Section."
	mount -t squashfs /dev/mtdblock4 /usr/www
fi

telnetd
commander

