#!/bin/sh

# This script runs when init it run during the boot process.
# Mounts everything in the fstab

mount -a
mount -o remount +w /
mount -t ramfs -n none /tmp

insmod /lib/modules/watchdog.ko
/usr/sbin/syschk
/etc/rc.d/rcDate

export PATH=$PATH:/etc/ath
insmod /lib/modules/2.6.15/net/ag7240_mod.ko
insmod /lib/modules/zcom_log.ko
insmod /lib/modules/zcommisc.ko
#insmod /lib/modules/zcom_gpio.ko

##
## Put the names of the interfaces in the environmental variables
## (They can be board unique)
##

#export ETH0=eth0
#export ETH1=eth1

#ifconfig $ETH0 up
#ifconfig $ETH1 up
#/etc/rc.d/rc.network
#/etc/rc.d/rc.bridge
#. /etc/ath/apcfg

#if [ "${WLAN_ON_BOOT}" = "y" ]; then
#    /etc/ath/apup > /dev/null 2>&1
#fi


#
# Untar the debug tools into /tmp/tools
#mkdir /tmp/tools
#cd /tmp/tools
#tar -xzvf /sbin/debug.tgz
#/usr/sbin/httpd -h /usr/www/
#/bin/factoryreset /dev/freset

ln -s /tmp/ /var/run
if [ ! -d /tmp/net-snmp ]; then
mkdir /tmp/net-snmp
fi
if [ ! -d /etc/dnrd ]; then
mkdir /etc/dnrd
fi
if [ ! -d /var/run/dhcp ]; then
mkdir /var/run/dhcp
fi

/usr/sbin/configserver &
/usr/sbin/webs &

# config for reduce TIME_WAIT
echo "30" > /proc/sys/net/ipv4/tcp_fin_timeout
echo "1800" > /proc/sys/net/ipv4/tcp_keepalive_time 
echo "0" > /proc/sys/net/ipv4/tcp_window_scaling
echo "0" > /proc/sys/net/ipv4/tcp_sack 
echo "0" > /proc/sys/net/ipv4/tcp_timestamps