#!/bin/sh

cd /mnt/mtd/modules && ./load3531a -i

modprobe nfs

rm /upgrade/ -rf
rm /mnt/mtd/preupgrade.sh
rm /mnt/mtd/productcheck

cd /mnt/mtd/
unlzma libApiNetSocket.so.lzma
unlzma libApiServer.so.lzma
unlzma libApiShareLib.so.lzma
unlzma libApiuuid.so.lzma

#telnetd &

export mac=$(cat /etc/init.d/mac.dat)
ifconfig eth0 down
ifconfig eth0 hw ether $mac
ifconfig eth0 up

ifconfig lo up
route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0

mount -t usbfs none /proc/bus/usb

ln -s /mnt/mtd/WebSites/logo /mnt/mtd/WebServer

if [ -f /mnt/mtd/debug.sh ]; then
	cd /mnt/mtd && ./DVRService &
	cd /mnt/mtd && ./debug.sh
	cd /mnt/mtd && ./td3531a &
else
	cd /mnt/mtd && ./XDVRStart.hisi ./td3531a &
fi
