#!/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 the RAM filesystem to /tmp
#
mount -t ramfs -n none /tmp
mkdir /tmp/net-snmp

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

export PATH=$PATH:/etc/ath
ln -s /tmp/ /var/run
insmod /lib/modules/2.6.15/net/ag7240_mod.ko
insmod /lib/modules/zcom_log.ko
#insmod /lib/modules/zcom_gpio.ko
insmod /lib/modules/zcommisc.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

#
# Enable USB
#
#insmod /lib/modules/2.6.15/usb/usbcore.ko
#insmod /lib/modules/2.6.15/usb/ohci-hcd.ko
#insmod /lib/modules/2.6.15/usb/usb-storage.ko

touch /etc/hosts
if [ ! -d /etc/dnrd ]; then
mkdir /etc/dnrd
fi
if [ ! -d /var/run/dhcp ]; then
mkdir /var/run/dhcp
fi

/etc/ath/apup
/usr/sbin/telnetd
/usr/sbin/vsftpd &
/usr/sbin/configserver &
/usr/sbin/webs &
