Infosatepg.sh
Aus VDR Wiki
(Unterschied zwischen Versionen)
Zeile 25: | Zeile 25: | ||
PATH=$PATH:/usr/local/bin | PATH=$PATH:/usr/local/bin | ||
− | if [ "$( | + | if [ -n "$(pidof infosatepg)" ] ; then |
svdrpsend.pl MESG "infosatepg is already running..." | svdrpsend.pl MESG "infosatepg is already running..." | ||
else | else | ||
svdrpsend.pl CHAN $CHANNEL | grep -e '^250.*' | svdrpsend.pl CHAN $CHANNEL | grep -e '^250.*' | ||
− | if [ | + | if [ $? -ne 0 ] ; then |
sleep 2s | sleep 2s | ||
svdrpsend.pl MESG "switch to $CHANNEL failed..." | svdrpsend.pl MESG "switch to $CHANNEL failed..." | ||
Zeile 37: | Zeile 37: | ||
PID=$! | PID=$! | ||
until ! ps -p $PID >/dev/null ; do | until ! ps -p $PID >/dev/null ; do | ||
− | if [ $SHOWSTATUS | + | if [ $SHOWSTATUS -eq 1 ] ; then |
STATUS=$(grep -s [0-9]% $INFOSAT_OUT/status | tail -n 1) | STATUS=$(grep -s [0-9]% $INFOSAT_OUT/status | tail -n 1) | ||
eval ${STATUS:+svdrpsend.pl MESG "$STATUS"} | eval ${STATUS:+svdrpsend.pl MESG "$STATUS"} | ||
Zeile 48: | Zeile 48: | ||
svdrpsend.pl HITK 0 | svdrpsend.pl HITK 0 | ||
fi | fi | ||
− | if [ "$1" -a -d $TVMOVIE2VDRDIR ] ; then | + | if [ -n "$1" -a -d $TVMOVIE2VDRDIR ] ; then |
cd $TVMOVIE2VDRDIR | cd $TVMOVIE2VDRDIR | ||
./tvm2vdr.pl >/var/log/tvmovie2vdr.log | ./tvm2vdr.pl >/var/log/tvmovie2vdr.log |
Version vom 3. März 2005, 17:12 Uhr
#!/bin/sh # # infosatepg.sh - v.0.6 # # add this lines to your commands.conf: # folgende zeilen in die commands.conf eintragen: # # Run infosatepg : echo "/usr/local/bin/infosatepg.sh" | at now # Run infosatepg + tvmovie2vdr : echo "/usr/local/bin/infosatepg.sh -tvmovie2vdr" | at now # # Edit the config.pl: # # - our $infosaturl="/video/received_data"; # + our $infosaturl="/tmp/received_data"; # CONFIG START INFOSAT_OPT="-v" # options INFOSAT_OUT="/tmp/received_data" # store infosatepg in CHANNEL="VIVA" # which channel, e.g: <NUM> or <NAME> TVMOVIE2VDRDIR="$SOURCEDIR/tvmovie2vdr" # path to tvmovie2vdr SHOWSTATUS="1" # show status (1=true/0=false) EPGSEARCHUPDATEFILE="/etc/vdr/plugins/.epgsearchupdate" # background scan epgsearch-plugin # CONFIG END PATH=$PATH:/usr/local/bin if [ -n "$(pidof infosatepg)" ] ; then svdrpsend.pl MESG "infosatepg is already running..." else svdrpsend.pl CHAN $CHANNEL | grep -e '^250.*' if [ $? -ne 0 ] ; then sleep 2s svdrpsend.pl MESG "switch to $CHANNEL failed..." else mkdir -p $INFOSAT_OUT infosatepg $INFOSAT_OPT -o $INFOSAT_OUT > $INFOSAT_OUT/status & PID=$! until ! ps -p $PID >/dev/null ; do if [ $SHOWSTATUS -eq 1 ] ; then STATUS=$(grep -s [0-9]% $INFOSAT_OUT/status | tail -n 1) eval ${STATUS:+svdrpsend.pl MESG "$STATUS"} fi sleep 30s done if grep -qs complete $INFOSAT_OUT/status ; then svdrpsend.pl MESG "infosatepg done..." sleep 2s svdrpsend.pl HITK 0 fi if [ -n "$1" -a -d $TVMOVIE2VDRDIR ] ; then cd $TVMOVIE2VDRDIR ./tvm2vdr.pl >/var/log/tvmovie2vdr.log fi touch $EPGSEARCHUPDATEFILE fi fi