#!/bin/sh
# set up the hostname
/bin/hostname rcell

# attach the interfaces
/sbin/ifattach

#Misc
>/var/log/messages

#Setting the IP address
. /var/config/inet_eth0_config
/sbin/ifconfig eth0 $ipaddress netmask $ipmask

#Bringing up loopback address
/sbin/ifconfig lo 127.0.0.1

# Enabling/ Disabling mii 
/sbin/mii-diag

(get-model) &

/sbin/load_iptables

# To create initfile used by chat 
/sbin/convert

/sbin/convert -a

###TO Fix The DHCP_ISSUE
/sbin/cp_dhcp_config

setup-device

#Enabling/Disabling the HTTP Service
(/sbin/boa -p 80) &

(/bin/pppd) &
/sbin/hstr-ipsec &

# Restores the iptable rules 
/sbin/restore-ipt
(/sbin/restore-gre) &

#(/sbin/wdt) &

#autodis

#/sbin/klogd

/sbin/syslogd -s 1 &

#Enabling/Disabling the SNTP Service
#(/sbin/msntp) &

(/sbin/inetd) &

# /sbin/ip route add default via 192.168.2.254 dev eth0 preference 100

#Enabling/Disabling the SNTP Service
#(/sbin/inadyn) &

(/sbin/dhcpd) &

#TCP/UDP client/server to run
#(/sbin/serv-cli) &

>/var/log/client_trace
>/var/log/server_trace

# Enabling/ Disabling pppcheck 
#(/sbin/pppcheck) &

#Enabling/Disabling the AGDISC Service
#(/sbin/agdisc) &
#/bin/echo 1 > /proc/led

#Auto Reboot timer
#(/sbin/soft-reboot) &
ln -s /dev/rtc0 /dev/rtc
>/var/log/gre-stats
echo 65535 > /var/run/reg_val
(/sbin/watchdog /dev/watchdog) &
(/sbin/CD-SS) &

insmod ipsec.ko

exit 0

