#!/bin/bash
echo starting at `date` >> /var/log/tvm2vdr.log
sleep 1
#/etc/init.d/ntpdate start >> /var/log/tvm2vdr.log

# start tvmovie2vdr
./tvm2vdr.pl >> /var/log/tvm2vdr.log

# clear old timer for vdr < 1.3.23
#./clearoldtimer.pl

# cleanup old images
find /video0/epgimages/ -type f  -mtime +10 -exec rm {} \;

# shutting down
if [ q"$1" == qpowerdown ]; then
	echo stopping and shutting down at `date` >> /var/log/tvm2vdr.log
	/usr/bin/svdrpsend.pl hitk POWER
	fi
