#! /bin/sh
export LD_LIBRARY_PATH=/mnt/others/lib:/lib:/usr/lib
export PATH=/mnt/others/sbin:/bin:/sbin:/usr/bin:/usr/sbin
export XTABLES_LIBDIR=/mnt/others/lib
export IPTABLES_LIB_DIR=/mnt/others/lib
export IP6TABLES_LIB_DIR=/mnt/others/lib
export ALSA_CONFIG_PATH=/usr/share/alsa/alsa.conf

KER_VER=`uname -r`

echo /sbin/mdev > /proc/sys/kernel/hotplug
mkdir -p /dev/shm
mkdir -p /dev/pts

# umount read/write project partition
umount /mnt/project

mount -a
mdev -s

. /home/profile
rm -rvf /var/run/*

modprobe gpio

#udpsvd -vE 0.0.0.0 69 tftpd /mnt/nfs&
#udhcpc -s /etc/udhcpc/default.script
# start sshd
#touch /var/Olympus/DISABLE_SSH
if [ -f /var/Olympus/DISABLE_SSH ]; then
echo "DISABLE SSH"
else
/mnt/others/sbin/sshd -d /etc/sshd/ssh_dss.key -r /etc/sshd/ssh_rsa.key -p 1587
fi
syslogd -O /mnt/log/message -S -s 1024 -b 23 -l 7

cp /mnt/others/sbin/isp /tmp
mkdir /uploads
mount -t tmpfs tmpfs /uploads
cp -rvf /mnt/project/ISP /uploads
/mnt/project/Zeus/zeus /mnt/project&
/tmp/isp&

#rpcbind
#unfsd

sysctl -w net.ipv4.tcp_fin_timeout=30
sysctl -w net.ipv4.tcp_tw_reuse=1
sysctl -w net.ipv4.tcp_tw_recycle=0 
sysctl -w net.ipv4.tcp_timestamps=0

# force kernel panic on oom
echo 1 > /proc/sys/vm/panic_on_oom
# set low-memory threshold to 16MB
echo 16384 > /proc/sys/vm/min_free_kbytes

# start audio aec debug program
/mnt/others/sbin/mic_dump &

#block https connection
#iptables -A INPUT -i eth0 -p tcp --destination-port 443 -j DROP
#ip6tables -A INPUT -i eth0 -p tcp --destination-port 443 -j DROP
#echo "block https connection"
