Installscript-recording-cmds
Aus VDR Wiki
(Unterschied zwischen Versionen)
(→Bsp (epg)) |
(M) |
||
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' -> | + | START='0' -> ../recording-cmds/before-clipinc.run |
− | START='1' -> | + | START='1' -> ../recording-cmds/before-noad.run |
− | START='2' -> | + | START='2' -> ../recording-cmds/before-sharemarks.run |
==Bsp ([[noad]])== | ==Bsp ([[noad]])== | ||
Zeile 49: | Zeile 49: | ||
*before-*) | *before-*) | ||
case $START in | case $START in | ||
− | 2) logit $0 "EXEC -> | + | 2) logit $0 "EXEC -> $CHECK $1 $2 $ONLINEMODE $ADDOPTS" |
− | + | noad $1 "$2" $ONLINEMODE $ADDOPTS | |
;; | ;; | ||
− | *) logit $0 "OFF -> no online mode | + | *) logit $0 "OFF -> no online mode" |
;; | ;; | ||
esac | esac | ||
Zeile 58: | Zeile 58: | ||
*after-*) | *after-*) | ||
case $START in | case $START in | ||
− | 1) logit $0 "EXEC -> | + | 1) logit $0 "EXEC -> $CHECK $1 $2 $ADDOPTS" |
− | + | noad $1 "$2" $ADDOPTS | |
;; | ;; | ||
− | 2) logit $0 "EXEC -> | + | 2) logit $0 "EXEC -> $CHECK $1 $2 $ONLINEMODE $ADDOPTS" |
noad $1 "$2" $ONLINEMODE $ADDOPTS | noad $1 "$2" $ONLINEMODE $ADDOPTS | ||
;; | ;; | ||
Zeile 86: | Zeile 86: | ||
case $0 in | case $0 in | ||
*before-*) | *before-*) | ||
− | logit $0 "EXEC -> | + | logit $0 "EXEC -> $CHECK $1 $2" |
marks2pts $1 "$2" | marks2pts $1 "$2" | ||
;; | ;; | ||
*edited-*) | *edited-*) | ||
case $START in | case $START in | ||
− | 2) logit $0 "EXEC -> | + | 2) logit $0 "EXEC -> $CHECK -upload $1 $2" |
marks2pts -upload $1 "$2" | marks2pts -upload $1 "$2" | ||
;; | ;; | ||
− | *) logit $0 "OFF -> no upload after cut | + | *) logit $0 "OFF -> no upload after cut" |
;; | ;; | ||
esac | esac | ||
Zeile 113: | Zeile 113: | ||
START="0" | START="0" | ||
− | ENTRY=$"0,1:Clipinc" | + | ENTRY=$"0,1:Clipinc (recinfo.conf)" |
CHECK=$(which vdrrecinfo.pl) | CHECK=$(which vdrrecinfo.pl) | ||
− | logit $0 "EXEC -> | + | logit $0 "EXEC -> $CHECK $1 $2" |
vdrrecinfo.pl $1 "$2" | vdrrecinfo.pl $1 "$2" | ||
</pre> | </pre> | ||
Zeile 146: | Zeile 146: | ||
if [ -z "${2/*\/wakeup\/*/}" ] ; then | if [ -z "${2/*\/wakeup\/*/}" ] ; then | ||
− | |||
for i in ${!EPG_*} ; do | for i in ${!EPG_*} ; do | ||
eval x=\$$i | eval x=\$$i | ||
Zeile 152: | Zeile 151: | ||
x=`echo ${i##*_} | tr A-Z a-z` | x=`echo ${i##*_} | tr A-Z a-z` | ||
if [ -x "$ADMDIR/start-cmds/rc/$x" ] ; then | if [ -x "$ADMDIR/start-cmds/rc/$x" ] ; then | ||
− | logit $0 "EXEC -> | + | logit $0 "EXEC -> $x start" |
cd "$ADMDIR/start-cmds/rc" | cd "$ADMDIR/start-cmds/rc" | ||
svdrpsend.pl -p ${VDR_PORT:-2001} MESG ""$"starting"" $x ..." | svdrpsend.pl -p ${VDR_PORT:-2001} MESG ""$"starting"" $x ..." | ||
sh $x start | sh $x start | ||
− | sleep | + | sleep 10s |
− | while pidof infosatepg -x tvm2vdr.pl -x tvim2vdr.pl | + | while pidof infosatepg -x tvm2vdr.pl -x tvim2vdr.pl ; do |
− | sleep | + | sleep 10s |
done | done | ||
svdrpsend.pl -p ${VDR_PORT:-2001} MESG "$x "$"done"" ..." | svdrpsend.pl -p ${VDR_PORT:-2001} MESG "$x "$"done"" ..." | ||
Zeile 171: | Zeile 170: | ||
fi | fi | ||
svdrpsend.pl -p ${VDR_PORT:-2001} HITK POWER | svdrpsend.pl -p ${VDR_PORT:-2001} HITK POWER | ||
− | + | fi >/dev/null 2>&1 & | |
− | + | ||
− | + | ||
− | + | ||
</pre> | </pre> | ||
}}[[Kategorie:Installscript]] | }}[[Kategorie:Installscript]] |
Version vom 24. Dezember 2005, 12:27 Uhr
Inhaltsverzeichnis |
Beschreibung
In ../recording-cmds befinden sich Scripte, welche vor / nach / schnitt einer Aufnahme ausgeführt werden.
Format (Datei):
after-<NAME>.run before-<NAME>.run edited-<NAME>.run
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)
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 (noad)
1 = Nach einer Aufnahme 2 = Online mode
#!/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="--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) logit $0 "EXEC -> $CHECK $1 $2 $ONLINEMODE $ADDOPTS" noad $1 "$2" $ONLINEMODE $ADDOPTS ;; *) logit $0 "OFF -> no online mode" ;; esac ;; *after-*) case $START in 1) logit $0 "EXEC -> $CHECK $1 $2 $ADDOPTS" noad $1 "$2" $ADDOPTS ;; 2) logit $0 "EXEC -> $CHECK $1 $2 $ONLINEMODE $ADDOPTS" noad $1 "$2" $ONLINEMODE $ADDOPTS ;; esac ;; esac
1 = Erzeugen der Schnittmarken 2 = Upload der Marken nach dem Schnitt
#!/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 (clipinc)
1 = Erzeugen der recinfo.conf
#!/bin/sh # # example wrapper script START="0" ENTRY=$"0,1:Clipinc (recinfo.conf)" CHECK=$(which vdrrecinfo.pl) logit $0 "EXEC -> $CHECK $1 $2" vdrrecinfo.pl $1 "$2"
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 ...
#!/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: 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 logit $0 "EXEC -> $x start" cd "$ADMDIR/start-cmds/rc" svdrpsend.pl -p ${VDR_PORT:-2001} MESG ""$"starting"" $x ..." sh $x start sleep 10s while pidof infosatepg -x tvm2vdr.pl -x tvim2vdr.pl ; do sleep 10s done svdrpsend.pl -p ${VDR_PORT:-2001} MESG "$x "$"done"" ..." fi fi done touch "$VDR_CONFIG/plugins/epgsearch/.epgsearchupdate" sleep 10s 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 fi >/dev/null 2>&1 &