Installscript-recording-cmds

Aus VDR Wiki
(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
(Bsp (epg): M)
(M)
Zeile 11: Zeile 11:
  
 
  START="0"                # 0 = inactiv, 1 = activ, 2 = + Option
 
  START="0"                # 0 = inactiv, 1 = activ, 2 = + Option
  ENTRY=$"0,2:Bechreibung"  # eintrag für das admin plugin <choices>:<description>
+
  ENTRY=$"0,2:Bechreibung"  # eintrag für das [[admin-plugin]] <choices>:<description>
  CHECK=$(test)             # tests
+
  CHECK=$(test xxx)         # tests
  
 
Das ganze kann im [[admin-plugin]] eingestellt werden. ('''0 = inactiv, 1 = activ, 2 = + Option''')
 
Das ganze kann im [[admin-plugin]] eingestellt werden. ('''0 = inactiv, 1 = activ, 2 = + Option''')
  
[[Bild:admin-plugin-02.jpg|thumb|none|''Bsp'']]
+
[[Bild:installscript-admin-recording-cmds.jpg|thumb|none|''kurze beschreibung'']]
  
 
Alles weitere sollte im '''syslog''' ersichtlich sein. (vorrausgesetzt '''$VDR_LOG -gt 0''')
 
Alles weitere sollte im '''syslog''' ersichtlich sein. (vorrausgesetzt '''$VDR_LOG -gt 0''')
Zeile 32: Zeile 32:
 
#!/bin/sh
 
#!/bin/sh
 
#
 
#
# example script (../../scripts/rwrapper.sh -> $0)
+
# example wrapper script
  
 
START="0"
 
START="0"
Zeile 78: Zeile 78:
 
#!/bin/sh
 
#!/bin/sh
 
#
 
#
# example script (../../scripts/rwrapper.sh -> $0)
+
# example wrapper script
  
 
START="0"
 
START="0"
Zeile 110: Zeile 110:
 
#!/bin/sh
 
#!/bin/sh
 
#
 
#
# example script (../../scripts/rwrapper.sh -> $0)
+
# example wrapper script
  
 
START="0"
 
START="0"
Zeile 130: Zeile 130:
 
Die Variable '''START''' ist hier ein wenig irreführend, siehe [[installscript-vdr.conf|vdr.conf]], das wären dann die EPG Einträge...  
 
Die Variable '''START''' ist hier ein wenig irreführend, siehe [[installscript-vdr.conf|vdr.conf]], das wären dann die EPG Einträge...  
  
[[Bild:admin-plugin-00.jpg|thumb|none|''Bsp'']]
+
[[Bild:installscript-admin-epg.jpg|thumb|none|''kurze beschreibung'']]
  
 
{{Box Datei| ../recording-cmds/after-wakeup.run |
 
{{Box Datei| ../recording-cmds/after-wakeup.run |
Zeile 136: Zeile 136:
 
#!/bin/sh
 
#!/bin/sh
 
#
 
#
# example script (../../scripts/rwrapper.sh -> $0)
+
# example wrapper script
  
 
START="1"
 
START="1"

Version vom 9. Dezember 2005, 09:02 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)

kurze beschreibung

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
Datei
../recording-cmds/{after,before}-noad.run
#!/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


Bsp (sharemarks)

1 = Erzeugen der Schnittmarken
2 = Upload der Marken nach dem Schnitt
Datei
../recording-cmds/{before,edited}-sharemarks.run
#!/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
Datei
../recording-cmds/before-clipinc.run
#!/bin/sh
#
# example wrapper script

START="0"
ENTRY=$"0,1:Clipinc"
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:

Somit kann man die täglichen EPG Geschichten an Hand eines Timers erledigen lassen... 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.run
#!/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 -> '$ADMDIR/start-cmds/rc/$x start'"
		cd "$ADMDIR/start-cmds/rc"
		sh $x start
		while pidof infosatepg -x tvm2vdr.pl -x tvim2vdr.pl >/dev/null ; do
		    sleep 10s
		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
  ) &
else
    logit $0 "OFF -> pattern '*/wakeup/*' not found in recording ..."
fi