#!/bin/sh

#modprobe hiether
#modprobe nfs
#cd /mnt/mtd/modules && ./load_master -s
rm /upgrade/ -rf
rm /mnt/mtd/preupgrade.sh
rm /mnt/mtd/productcheck

rm -rf /usr/local/bin/top
rm -rf /usr/sbin/mkdosfs

#解压驱动文件
mkdir /nfsdir/modules/
tar -zxvf /mnt/mtd/modules/modules.tar.gz -C /nfsdir/modules/

#insmod /lib/modules/2.6.24-rt1-hi3515v100/misc/hiether.ko
insmod /nfsdir/modules/extdrv/hiether.ko
cd /nfsdir/modules/ && ./load3515 -i

#删除驱动文件
rm /nfsdir/modules -rf

rm /nfsdir/language -rf
mkdir /nfsdir/language
tar -xzf /mnt/mtd/WebSites/language.tar.gz -C /nfsdir/language
rm /mnt/mtd/WebSites/language -rf
#mkdir /mnt/mtd/WebSites/language
ln -s /nfsdir/language  /mnt/mtd/WebSites/

rm /nfsdir/dvr/language -rf
mkdir -p /nfsdir/dvr/language
tar -xzf /mnt/mtd/language.tar -C /nfsdir/dvr/language
rm /mnt/mtd/language -rf
ln -s /nfsdir/dvr/language  /mnt/mtd/



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
                                                    
cd /mnt/mtd && ./XDVRStart.hisi ./td3515 &
#解压出login页面所需的js页面
#mkdir /nfsdir/script
#tar -zxf /mnt/mtd/WebSites/script/script.tar.gz main.js -C /nfsdir/script/
#tar -zxf /mnt/mtd/WebSites/script/script.tar.gz login.js -C /nfsdir/script/
#tar -zxf /mnt/mtd/WebSites/script/script.tar.gz flush_string.js -C /nfsdir/script/
#tar -zxf /mnt/mtd/WebSites/script/script.tar.gz Load_WebKit.js -C /nfsdir/script/
#tar -zxf /mnt/mtd/WebSites/script/script.tar.gz ctrl_multi_edit.js -C /nfsdir/script/
