Installscript-recording-cmds

Aus VDR Wiki
(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
K (Änderungen von Benutzer:Anonymous rückgängig gemacht und letzte Version von Benutzer:84.186.37.206 wiederhergestellt)
K (Bsp (sharemarks))
Zeile 105: Zeile 105:
 
case $START in
 
case $START in
 
    2) logit $0 "EXEC -> $CHECK -upload $1 $2"
 
    2) logit $0 "EXEC -> $CHECK -upload $1 $2"
marks2pts -upload $1 "$2"
+
marks2pts --non-interactive --upload $1 "$2"
 
;;
 
;;
 
    *) logit $0 "OFF -> no upload after cut"
 
    *) logit $0 "OFF -> no upload after cut"
Zeile 114: Zeile 114:
 
</pre>
 
</pre>
 
}}
 
}}
 
 
  
 
==Bsp (epg)==
 
==Bsp (epg)==

Version vom 31. Dezember 2006, 14:08 Uhr

Inhaltsverzeichnis

Beschreibung

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

Format (Datei):

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

Format (Head):

START="0"                 # 0 = inactiv, 1 = activ, 2 = + Option
ENTRY=$"0,2:Bechreibung"  # eintrag für das admin-plugin <choices>:<description>
CHECK=$(test xxx)         # tests

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

kurze beschreibung

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

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

Bsp (noad)

1 = Nach einer Aufnahme
2 = Online mode
Datei
../recording-cmds/{after,before}-noad.cmd
#!/bin/sh
#
# example wrapper script

START="0"
ENTRY=$"0,2:Noad (0=off,1=on,2=online mode)"
CHECK=$(which noad)

# set the online-mode here
# 1 means online for live-recording only
# 2 means online for every recording
ONLINEMODE="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) logit $0 "EXEC -> $CHECK $1 $ADDOPTS --online=$ONLINEMODE $2"
		noad $1 $ADDOPTS --online=$ONLINEMODE "$2"
		;;
	     *) logit $0 "OFF -> no online mode"
		;;
	esac
	;;
     *after-*)
	case $START in
	     1) logit $0 "EXEC -> $CHECK $1 $ADDOPTS $2"
		noad $1 $ADDOPTS "$2"
		;;
	     2) logit $0 "EXEC -> $CHECK $1 $ADDOPTS --online=$ONLINEMODE $2"
		noad $1 $ADDOPTS --online=$ONLINEMODE "$2"
		;;
	esac
	;;
esac

if ! screen -ls | egrep -q noadwatch ; then
    screen -dmS noadwatch sh -c "while pidof noad ; do \
	for i in \$(pidof noad) ; do \
	    sleep 5s ; ARGS=\$(ps --no-heading -p \$i -o %a) ; \
	    if [ ! -d \"\${ARGS##* }\" -a -n \"\${ARGS##* }\" ] ; then \
		if ps -p \$i ; then \
		    kill -9 \$i ; \
		fi ; \
	    fi ; \
	done ; \
    done"
fi


Bsp (sharemarks)

1 = Erzeugen der sharemarks.conf
2 = + Upload der Marken nach dem Schnitt
Datei
../recording-cmds/{before,edited}-sharemarks.cmd
#!/bin/sh
#
# example wrapper script

START="0"
ENTRY=$"0,2:Sharemarks (0=off,1=on,2=upload)"
CHECK=$(which marks2pts)

case $0 in
     *before-*)
	logit $0 "EXEC -> $CHECK $1 $2"
	marks2pts $1 "$2"
	;;
     *edited-*)
	case $START in
	     2) logit $0 "EXEC -> $CHECK -upload $1 $2"
		marks2pts --non-interactive --upload $1 "$2"
		;;
	     *) logit $0 "OFF -> no upload after cut"
		;;
	esac
	;;
esac


Bsp (epg)

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

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

Über diesen lassen sich dann die täglichen EPG Geschichten erledigen ... ohne die crontab zuzumüllen, desweiteren entfallen ellenlange shutdown script(s).

Die Variable START ist hier ein wenig irreführend, siehe vdr.conf, das wären dann die EPG Einträge ...

Datei
../recording-cmds/after-wakeup.cmd
#!/bin/sh
#
# example wrapper script

START="1"

# 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:

case $2 in
     */wakeup/*)
	EXECFILE=/tmp/wakeup.$$
        cat << EOT > $EXECFILE
	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
		    logit $0 "EXEC -> \$x start"
		    cd "$ADMDIR/start-cmds/rc"
		    $SVDRPSENDCMD MESG "starting \$x ..."
		    sh \$x start
		    while screen -ls | egrep -q \$x ; do
			sleep 5s
		    done
		    $SVDRPSENDCMD MESG "\$x done ..."
		fi
	    fi
	done
	$SVDRPSENDCMD PLUG epgsearch UPDS OSD
	DELR=( \$($SVDRPSENDCMD LSTR | grep " wakeup" | tr - ' ') )
	if [ -n "\${DELR[1]}" ] ; then
	    $SVDRPSENDCMD DELR \${DELR[1]}
	fi
	$SVDRPSENDCMD HITK POWER
	rm -f $EXECFILE
EOT
	screen -dmS $$ sh -c "sh $EXECFILE"
	;;
esac