Infosatepg.sh

Aus VDR Wiki
Wechseln zu: Navigation, Suche

Skript von infosatepg.

Datei
$PATH/infosatepg.sh
#!/bin/sh
#
# infosatepg.sh
#
# Required: screen, svdrpsend.pl, infosatepg, tvm2vdr.pl (optional)
#
# add this lines to your commands.conf:
# folgende zeilen in die commands.conf eintragen:
#
# Run infosatepg               : /path_to_this_script/infosatepg.sh start
# Run infosatepg + tvmovie2vdr : /path_to_this_script/infosatepg.sh start +
# Status                       : /path_to_this_script/infosatepg.sh status
#
# Edit the config.pl:
#
# - our $infosaturl="/video/received_data";
# + our $infosaturl="/usr/local/cache/infosatepg";

# CONFIG START
  OPT="-v"                                     # options
  CHANNEL="TechniSat Kanal 50"                 # which channel, e.g: <NUM> or <NAME>
  CLEANUP="10"                                 # cleanup files (older n*24 hours ago)
  OUT="/usr/local/cache/infosatepg"            # store infosatepg in
  TVMOVIE2VDRDIR="${SOURCEDIR:?}/tvmovie2vdr"  # tvmovie2vdr directory
  LOGFILE="/var/log/vdr/infosatepg.log"        # logfile
# CONFIG END

# cleanup old images
find "$OUT" -follow -type f -mtime +${CLEANUP:-100} -exec rm {} \;

case $1 in
     start)
	if screen -ls | egrep -q infosatepg ; then
	    echo "infosatepg is already running..."
	else
	    screen -dmS infosatepg sh -c " \
	    infosatepg $OPT -c \"$CHANNEL\" -o \"$OUT\" > \"$LOGFILE\" 2>&1 ; \
	    if [ -n \"\$2\" ] ; then \
		cd \"$TVMOVIE2VDRDIR\" ; ./tvm2vdr.pl ; \
	    fi \
	    "
	fi
	;;
     status)
	screen -ls | egrep -c infosatepg
	;;
     *)
	echo "Usage: $0 {start|status}" >&2
        exit 1
esac

exit $?