Installscript-recording-cmds

Aus VDR Wiki
(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
(Bsp (noad))
K (obsolete)
Zeile 95: Zeile 95:
 
}}
 
}}
  
==Bsp (epg)==
+
[[Kategorie:Installscript]]
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 [[installscript-vdr.conf|vdr.conf]], das wären dann die EPG Einträge ...
+
 
+
[[Bild:installscript-admin-epg.jpg|thumb|none|''kurze beschreibung'']]
+
 
+
{{Box Datei| ../recording-cmds/after-wakeup.cmd |
+
<pre>
+
#!/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
+
</pre>
+
}}[[Kategorie:Installscript]]
+

Version vom 29. Oktober 2007, 06:44 Uhr

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"

# the maximum amount of virtual memory available to the shell
MAXSIZE="2000"

case $0 in
     *before-*)
	case $START in
	     2) logit $0 "EXEC -> $CHECK $1 $ADDOPTS --online=$ONLINEMODE $2"
		ulimit -v $MAXSIZE
		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"
		ulimit -v $MAXSIZE
		noad $1 $ADDOPTS "$2"
		;;
	     2) logit $0 "EXEC -> $CHECK $1 $ADDOPTS --online=$ONLINEMODE $2"
		ulimit -v $MAXSIZE
		noad $1 $ADDOPTS --online=$ONLINEMODE "$2"
		;;
	esac
	;;
esac
fi


Bsp (sharemarks)

1 = Upload der Marken nach dem Schnitt
Datei
../recording-cmds/edited-sharemarks.cmd
#!/bin/sh
#
# example wrapper script

START="0"
ENTRY=$"0,1:Sharemarks, upload after cut"
CHECK=$(which marks2pts)

logit $0 "EXEC -> $CHECK -upload $1 $2"
marks2pts --non-interactive --upload $1 "$2"