Installscript-recording-cmds

Aus VDR Wiki
(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
(Beschreibung)
Zeile 8: Zeile 8:
 
  edited-<NAME>.run
 
  edited-<NAME>.run
  
Im Beispiel wird der Werbefilter [[noad]] aufgerufen.
+
Im Beispiel (1) wird der Werbefilter [[noad]] aufgerufen.
  
 
Das ganze kann im [[admin-plugin]] eingestellt werden. ('''0 = inactiv, 1 = activ, 2 = online mode''')
 
Das ganze kann im [[admin-plugin]] eingestellt werden. ('''0 = inactiv, 1 = activ, 2 = online mode''')
Zeile 20: Zeile 20:
 
  'START'='2' -> '../recording-cmds/before-sharemarks.run'
 
  'START'='2' -> '../recording-cmds/before-sharemarks.run'
  
==Bsp==
+
==Bsp (1)==
 
{{Box Datei| ../recording-cmds/{after,before}-noad.run |
 
{{Box Datei| ../recording-cmds/{after,before}-noad.run |
 
<pre>
 
<pre>
Zeile 56: Zeile 56:
 
esac
 
esac
 
</pre>
 
</pre>
}}[[Kategorie:Installscript]]
+
}}
 +
 
 +
==Bsp (2)==
 +
Wird ausgeführt, wenn in der Aufnahme der Name/Pattern '''/wakeup/''' vorkommt, am besten einen Timer anlegen, zbs.
 +
 
 +
1:S19.2E-1-1116-12732:MDMDFSS:0300:0301:0:1:wakeup:
 +
 
 +
Somit kann man die EPG Geschichten an Hand eines Timers erledigen lassen...
 +
 
 +
{{Box Datei| ../recording-cmds/after-wakeup.run |
 +
<pre>
 +
#!/bin/sh
 +
#
 +
# example script (../../scripts/rwrapper.sh -> $0)
 +
 
 +
START="1"
 +
UPDATEEPG_LOGFILE="/var/log/vdr/updateepg.log"
 +
 
 +
# add this line to your timers.conf:
 +
# folgende zeile in die timers.conf eintragen:
 +
#
 +
# 1:S19.2E-1-1116-12732:MDMDFSS:0300:0301:0:1:wakeup:
 +
 
 +
if [ -z "${2/*\/wakeup\/*/}" ] ; then
 +
    (
 +
for i in ${!EPG_*} ; do
 +
    eval x=\$$i
 +
    if [ $x -eq 1 ] ; then
 +
x=`echo ${i##*_} | tr A-Z a-z`
 +
if [ -x "$ADMDIR/start-cmds/rc/$x" ] ; then
 +
    date
 +
    echo "============================="
 +
    cd "$ADMDIR/start-cmds/rc"
 +
    sh $x startnobg
 +
    echo
 +
fi
 +
    fi
 +
done
 +
date
 +
echo "============================="
 +
touch "$VDR_CONFIG/plugins/epgsearch/.epgsearchupdate"
 +
sleep 30s
 +
DELR=( $(svdrpsend.pl -p ${VDR_PORT:-2001} LSTR | grep " wakeup" | tr - ' ') )
 +
if [ -n "${DELR[1]}" ] ; then
 +
    svdrpsend.pl -p ${VDR_PORT:-2001} DELR ${DELR[1]}
 +
fi
 +
svdrpsend.pl -p ${VDR_PORT:-2001} HITK POWER
 +
    ) > $UPDATEEPG_LOGFILE 2>&1 &
 +
fi
 +
</pre>
 +
}}

Version vom 22. Oktober 2005, 23:17 Uhr

Beschreibung

In ../recording-cmds befinden sich Scripte, welche vor / nach / schnitt einer Aufnahme ausgeführt werden.

Format:

after-<NAME>.run
before-<NAME>.run
edited-<NAME>.run

Im Beispiel (1) wird der Werbefilter noad aufgerufen.

Das ganze kann im admin-plugin eingestellt werden. (0 = inactiv, 1 = activ, 2 = online mode)

Alles weitere sollte im syslog ersichtlich sein. (vorrausgesetzt $VDR_LOG -gt 0)

'START'='0' -> '../recording-cmds/before-clipinc.run'
'START'='1' -> '../recording-cmds/before-noad.run'
'START'='2' -> '../recording-cmds/before-sharemarks.run'

Bsp (1)

Datei
../recording-cmds/{after,before}-noad.run
#!/bin/sh
#
# example script (../../scripts/rwrapper.sh -> $0)

START="0"                                    # 0 = inactiv / 1 = activ / 2 = online mode
ENTRY=$"0,2:Noad (0=off,1=on,2=online mode)" # eintrag für das admin plugin
CHECK=$(which noad)                          # test

# set the online-mode here
# 1 means online for live-recording only
# 2 means online for every recording
ONLINEMODE="--online=1"

# set additional args for every call here here
ADDOPTS="--ac3 --overlap --jumplogo --comments --statisticfile=/var/log/vdr/noad.log"

case $0 in
     *before-*)
	case $START in
	     2) noad $1 "$2" $ONLINEMODE $ADDOPTS
		;;
	esac
	;;
     *after-*)
	case $START in
	     1) noad $1 "$2" $ADDOPTS
		;;
	     2) noad $1 "$2" $ONLINEMODE $ADDOPTS
		;;
	esac
	;;
esac


Bsp (2)

Wird ausgeführt, wenn in der Aufnahme der Name/Pattern /wakeup/ vorkommt, am besten einen Timer anlegen, zbs.

1:S19.2E-1-1116-12732:MDMDFSS:0300:0301:0:1:wakeup:

Somit kann man die EPG Geschichten an Hand eines Timers erledigen lassen...

Datei
../recording-cmds/after-wakeup.run
#!/bin/sh
#
# example script (../../scripts/rwrapper.sh -> $0)

START="1"
UPDATEEPG_LOGFILE="/var/log/vdr/updateepg.log"

# add this line to your timers.conf:
# folgende zeile in die timers.conf eintragen:
#
# 1:S19.2E-1-1116-12732:MDMDFSS:0300:0301:0:1:wakeup:

if [ -z "${2/*\/wakeup\/*/}" ] ; then
    (
	for i in ${!EPG_*} ; do
	    eval x=\$$i
	    if [ $x -eq 1 ] ; then
		x=`echo ${i##*_} | tr A-Z a-z`
		if [ -x "$ADMDIR/start-cmds/rc/$x" ] ; then
		    date
		    echo "============================="
		    cd "$ADMDIR/start-cmds/rc"
		    sh $x startnobg
		    echo
		fi
	    fi
	done
	date
	echo "============================="
	touch "$VDR_CONFIG/plugins/epgsearch/.epgsearchupdate"
	sleep 30s
	DELR=( $(svdrpsend.pl -p ${VDR_PORT:-2001} LSTR | grep " wakeup" | tr - ' ') )
	if [ -n "${DELR[1]}" ] ; then
	    svdrpsend.pl -p ${VDR_PORT:-2001} DELR ${DELR[1]}
	fi
	svdrpsend.pl -p ${VDR_PORT:-2001} HITK POWER
    ) > $UPDATEEPG_LOGFILE 2>&1 &
fi