Welcome to our community

Be apart of something great, join today!

Amending a script for the dm600

wizbit77

Inactive User
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.
 
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
 
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