Installscript-recording-cmds

Aus VDR Wiki
(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
(Bsp (clipinc): obsolete...)
(M)
Zeile 4: Zeile 4:
 
Format (Datei):
 
Format (Datei):
  
  after-'''<NAME>'''.run
+
  after-'''<NAME>'''.cmd
  before-'''<NAME>'''.run
+
  before-'''<NAME>'''.cmd
  edited-'''<NAME>'''.run
+
  edited-'''<NAME>'''.cmd
  
 
Format (Head):
 
Format (Head):
Zeile 20: Zeile 20:
 
Alles weitere sollte im '''syslog''' ersichtlich sein. (vorrausgesetzt '''$VDR_LOG -gt 0''')
 
Alles weitere sollte im '''syslog''' ersichtlich sein. (vorrausgesetzt '''$VDR_LOG -gt 0''')
  
  START='0' -> ../recording-cmds/before-clipinc.run
+
  START='0' -> ../recording-cmds/before-clipinc.cmd
  START='1' -> ../recording-cmds/before-noad.run
+
  START='1' -> ../recording-cmds/before-noad.cmd
  START='2' -> ../recording-cmds/before-sharemarks.run
+
  START='2' -> ../recording-cmds/before-sharemarks.cmd
  
 
==Bsp ([[noad]])==
 
==Bsp ([[noad]])==
Zeile 28: Zeile 28:
 
  '''2''' = Online mode
 
  '''2''' = Online mode
  
{{Box Datei| ../recording-cmds/{after,before}-noad.run |
+
{{Box Datei| ../recording-cmds/{after,before}-noad.cmd |
 
<pre>
 
<pre>
 
#!/bin/sh
 
#!/bin/sh
Zeile 87: Zeile 87:
 
  '''2''' = + Upload der Marken nach dem Schnitt
 
  '''2''' = + Upload der Marken nach dem Schnitt
  
{{Box Datei| ../recording-cmds/{before,edited}-sharemarks.run |
+
{{Box Datei| ../recording-cmds/{before,edited}-sharemarks.cmd |
 
<pre>
 
<pre>
 
#!/bin/sh
 
#!/bin/sh
Zeile 128: Zeile 128:
 
[[Bild:installscript-admin-epg.jpg|thumb|none|''kurze beschreibung'']]
 
[[Bild:installscript-admin-epg.jpg|thumb|none|''kurze beschreibung'']]
  
{{Box Datei| ../recording-cmds/after-wakeup.run |
+
{{Box Datei| ../recording-cmds/after-wakeup.cmd |
 
<pre>
 
<pre>
 
#!/bin/sh
 
#!/bin/sh

Version vom 8. September 2006, 08:48 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 -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