summaryrefslogtreecommitdiff
path: root/Tools/epg2timers/update_timers.old
blob: c4c3f5c5e467c103d61fa0924757ea67893513fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

# update_timers: load a new "merkliste" from http://tvtv.de
# and create a new VDR timer configuration file (timers.conf)
# from it. Restart VDR if the timers have changed.

TOOLDIR="/home/cko/bin"
VDRDIR="/home/cko/VDR"

cd /tmp
rm -f merkliste.html epgtimers.new epgtimers.old vdrtimers.old
ping -c 2 www.tvtv.de
$TOOLDIR/get_merkliste.pl
if [ -s merkliste.html ] ; then
   $TOOLDIR/epg2timers $VDRDIR/channels.conf < merkliste.html | sort -t: +2.0 -5.0 > epgtimers.new
   fgrep '(epg2timers)' $VDRDIR/timers.conf | sort -t: +2.0 -5.0 > epgtimers.old
   if ! cmp -s epgtimers.old epgtimers.new ; then
      /sbin/killproc $VDRDIR/vdr
      fgrep -v '(epg2timers)' $VDRDIR/timers.conf > vdrtimers.old
      cat epgtimers.new vdrtimers.old | sort -t: +2.0 -5.0 > $VDRDIR/timers.conf
      echo "Timers updated."
   fi
fi
rm -f merkliste.html epgtimers.new epgtimers.old vdrtimers.old