Amending a script for the dm600

wizbit77

Inactive User
Joined
Jun 3, 2007
Messages
569
Reaction score
18
Hi guys,
there is a fault with one of the sripts that rusn the extended epg on the dreambox that curious123 has discovered (with a little help from the guys at pli). It would be nice to amend the script but I haven't the foggiest where to start.
Help would be appreciated from anyone who has knowledge of this type of programming or if someone could point me in the right direction of a tut?
Thanks
Wizbit77.
 
Here is the script in question i have renamed it to upload it.
 
Last edited:
Thanks to Osborne82 I have now added the following last 3 lines to the script

wget http://xmltv.radiotimes.com/xmltv/channels.dat -O /tmp/rt_channels.dat
then
echo "cp /tmp/rt_channels.dat /var/tuxbox/config/dbepg"
cp /tmp/rt_channels.dat /var/tuxbox/config/dbepg

.. and this looks as if it has fixed the problem.
 
No the cron is working fine but the script for retriving the file is dumping the information into tmp directory instead of /var/tuxbox/config/dbepg where it is required.
 
So is this how the script should read now?

#/bin/sh
configdir=/var/tuxbox/config/dbepg

convert=/var/bin/db_epg
configfile=$configdir/rt_uk.cfg

# Some default values, to make sure they are set..
epg=/var/lib/sqlite/epg.db
hours=72
timeOffset=0
mapfile=$configdir/rt_uk_channels.dat
genrefile=$configdir/genre.dat

OIFS="$IFS"
IFS='='
while read opt val ; do
case "$opt" in
"timeOffset")
timeOffset=$val ;
;;
"numOfDays")
hours=$((24*$val)) ;
;;
"mapfile")
mapfile=$configdir/$val ;
;;
"genreMap")
genrefile=$configdir/$val ;
;;
"epgLocation")
epg=$val ;
;;
esac;
done < $configfile

IFS="$OIFS"

echo "Retrievel $hours hours of channel data, using a timeOffset of $timeOffset seconds."
touch $mapfile

[ ! -f $epg ] && echo "Database not found" && exit 10
[ ! -f $convert ] && echo "Converter $convert not found" && exit 11
[ ! -f $mapfile ] && echo "Mapfile $mapfile not found" && exit 12

IFS='='

#Feedback for plugin
#count=`grep -v '^UNKNOWN' $mapfile | grep -v '^IGNORE' | wc -l`
#Send '#count:" with the number of files
#Send '#cur:" for each file
#echo "#count:$count"
#current=0

while read serviceRef chanId ; do
if [ $serviceRef != "UNKNOWN" ] && [ $serviceRef != "IGNORE" ]
then
# echo "#cur:$current"
# current=$(($current+1))
echo "wget http://xmltv.radiotimes.com/xmltv/$chanId.dat -O /tmp/$chanId.dat"
wget "http://xmltv.radiotimes.com/xmltv/$chanId.dat" -O "/tmp/$chanId.dat"
if [ -f "/tmp/$chanId.dat" ]; then
echo "$convert -t uk_rt -d $epg -f /tmp/$chanId.dat -o $timeOffset -h $hours -r $serviceRef"
$convert -t uk_rt -d "$epg" -f "/tmp/$chanId.dat" -o $timeOffset -h $hours -r $serviceRef --genre "$genrefile"
rm "/tmp/$chanId.dat"
fi
fi
done < $mapfile;

IFS="$OIFS"

#get latest channels.dat for future references
echo "wget http://xmltv.radiotimes.com/xmltv/channels.dat -O /tmp/rt_channels.dat"
wget http://xmltv.radiotimes.com/xmltv/channels.dat -O /tmp/rt_channels.dat
echo "cp /tmp/rt_channels.dat /var/tuxbox/config/dbepg"
cp /tmp/rt_channels.dat /var/tuxbox/config/dbepg



exit 0
 
Yes thats the way it should look, save it and overwrite the old script on the image..
 
I amended the script as above, but when you press the button to download the yellow button to do a manual retrieve, it wouldn't download anything. Had to revert back to orig script for the plugin to retrieve the epg.
 
I amended the script as above, but when you press the button to download the yellow button to do a manual retrieve, it wouldn't download anything. Had to revert back to orig script for the plugin to retrieve the epg.

make sure it looks like

Code:
You don't have permission to view the code content. Log in or register now.

i think u missed the "then" from it also check once ftp back over that its still chmod 755 so it can execute

cheers

osborne82
 
Back
Top