#!/bin/sh

cd /tmp
CONF=/etc/config/qpkg.conf
QPKG_NAME="DVBLinkTVServer"
DVBLINK_INSTALL_DIR=$(/sbin/getcfg $QPKG_NAME Install_Path -d "" -f $CONF)
export LD_LIBRARY_PATH=$DVBLINK_INSTALL_DIR/lib

if [ ! -e TVH_Dev_Sundtek_0.5.qpkg ]; then
	wget http://sundtek.de/support/TVH_Dev_Sundtek_0.5.qpkg
fi
FORCE64=1 /bin/sh TVH_Dev_Sundtek_0.5.qpkg
CONF=/etc/config/qpkg.conf
QPKG_NAME="DVBLinkTVServer"
DVBLINK_INSTALL_DIR=$(/sbin/getcfg $QPKG_NAME Install_Path -d "" -f $CONF)
cd $DVBLINK_INSTALL_DIR

# make a backup of the file, only one 
if [ ! -e start2.sh.backup ]; then
	mv start2.sh start2.sh.backup
fi
rm -rf start2.sh
wget http://sundtek.de/support/start2.sh
chmod 777 start2.sh
