Installscript-recording-cmds

Aus VDR Wiki
(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
(Bsp (2))
(Bsp ({edited,before,after}-userdev.cmd): M)
 
(47 dazwischenliegende Versionen von 15 Benutzern werden nicht angezeigt)
Zeile 2: Zeile 2:
 
In '''../recording-cmds''' befinden sich Scripte, welche '''vor / nach / schnitt''' einer Aufnahme ausgeführt werden.
 
In '''../recording-cmds''' befinden sich Scripte, welche '''vor / nach / schnitt''' einer Aufnahme ausgeführt werden.
  
Format:
+
Format (Datei):
  
  after-<NAME>.run
+
  after-'''<NAME>'''.cmd
  before-<NAME>.run
+
  before-'''<NAME>'''.cmd
  edited-<NAME>.run
+
  edited-'''<NAME>'''.cmd
  
Im Beispiel (1) wird der Werbefilter [[noad]] aufgerufen.
+
Format (Head):
  
Das ganze kann im [[admin-plugin]] eingestellt werden. ('''0 = inactiv, 1 = activ, 2 = online mode''')
+
START="0"                # 0 = inactiv, 1 = activ, 2 = + Option
 +
ENTRY=$"0,2:Bechreibung"  # eintrag für das [[admin-plugin]] <choices>:<description>
 +
CHECK=$(test xxx)         # tests
  
[[Bild:admin-plugin-02.jpg|thumb|none|''Bsp'']]
+
Das ganze kann im [[admin-plugin]] eingestellt werden. ('''0 = inactiv, 1 = activ, 2 = + Option''')
 +
 
 +
''Oder, auf der Kommandozeile.''
 +
 
 +
shell> [[Installscript-dialog.sh|$PREFIX/etc/vdr/admin/dialog.sh]]
 +
 
 +
[[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''')
  
  'START'='0' -> '../recording-cmds/before-clipinc.run'
+
  START='0' -> ../recording-cmds/before-clipinc.cmd
  'START'='1' -> '../recording-cmds/before-noad.run'
+
  START='2' -> ../recording-cmds/before-sharemarks.cmd
  'START'='2' -> '../recording-cmds/before-sharemarks.run'
+
 
 +
==Bsp ([[noad]])==
 +
  '''1''' = Nach einer Aufnahme
 +
'''2''' = Online mode
  
==Bsp (1)==
+
{{Box Datei| ../recording-cmds/{after,before}-noad.cmd |
{{Box Datei| ../recording-cmds/{after,before}-noad.run |
+
 
<pre>
 
<pre>
 
#!/bin/sh
 
#!/bin/sh
 
#
 
#
# example script (../../scripts/rwrapper.sh -> $0)
+
# example wrapper script
  
START="0"                                   # 0 = inactiv / 1 = activ / 2 = online mode
+
START="0"
ENTRY=$"0,2:Noad (0=off,1=on,2=online mode)" # eintrag für das admin plugin
+
ENTRY=$"0,2:Noad (0=off,1=on,2=online mode)"
CHECK=$(which noad)                         # test
+
CHECK=$(which noad)
  
 
# set the online-mode here
 
# set the online-mode here
 
# 1 means online for live-recording only
 
# 1 means online for live-recording only
 
# 2 means online for every recording
 
# 2 means online for every recording
ONLINEMODE="--online=1"
+
ONLINEMODE="1"
  
 
# set additional args for every call here here
 
# set additional args for every call here here
 
ADDOPTS="--ac3 --overlap --jumplogo --comments --statisticfile=/var/log/vdr/noad.log"
 
ADDOPTS="--ac3 --overlap --jumplogo --comments --statisticfile=/var/log/vdr/noad.log"
 +
 +
# the maximum amount of virtual memory available to the shell
 +
MAXSIZE="20000"
  
 
case $0 in
 
case $0 in
 
     *before-*)
 
     *before-*)
 
case $START in
 
case $START in
    2) noad $1 "$2" $ONLINEMODE $ADDOPTS
+
    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
 
esac
Zeile 48: Zeile 65:
 
     *after-*)
 
     *after-*)
 
case $START in
 
case $START in
    1) noad $1 "$2" $ADDOPTS
+
    1) logit $0 "EXEC -> $CHECK $1 $ADDOPTS $2"
 +
ulimit -v $MAXSIZE
 +
noad $1 $ADDOPTS "$2"
 
;;
 
;;
    2) noad $1 "$2" $ONLINEMODE $ADDOPTS
+
    2) logit $0 "EXEC -> $CHECK $1 $ADDOPTS --online=$ONLINEMODE $2"
 +
ulimit -v $MAXSIZE
 +
noad $1 $ADDOPTS --online=$ONLINEMODE "$2"
 
;;
 
;;
 
esac
 
esac
 
;;
 
;;
 
esac
 
esac
 +
fi
 
</pre>
 
</pre>
 
}}
 
}}
  
==Bsp (2)==
+
==Bsp ([[sharemarks]])==
Wird ausgeführt, wenn in der Aufnahme der Name/Pattern '''/wakeup/''' vorkommt, am besten einen Timer anlegen, zbs.
+
'''1''' = Upload der Marken nach dem Schnitt
  
1:S19.2E-1-1116-12732:MDMDFSS:0300:0301:0:1:wakeup:
+
{{Box Datei| ../recording-cmds/edited-sharemarks.cmd |
 +
<pre>
 +
#!/bin/sh
 +
#
 +
# example wrapper script
  
Somit kann man die EPG Geschichten an Hand eines Timers erledigen lassen... ohne die '''crontab''' zuzumüllen, desweiteren entfallen ''ellenlange'' shutdown scrip(s).
+
START="0"
 +
ENTRY=$"0,1:Sharemarks, upload after cut"
 +
CHECK=$(which marks2pts)
  
{{Box Datei| ../recording-cmds/after-wakeup.run |
+
logit $0 "EXEC -> $CHECK -upload $1 $2"
 +
marks2pts --non-interactive --upload $1 "$2"
 +
</pre>
 +
}}
 +
 
 +
==Bsp ({edited,before,after}-userdev.cmd)==
 +
'''1''' = Führt, Benutzerdefinierte Befehle aus, welche in '''EXEC{B,A,E}''' hinterlegt werden können.
 +
 
 +
{{Box Datei| ../recording-cmds/{edited,before,after}-userdev.cmd
 
<pre>
 
<pre>
 
#!/bin/sh
 
#!/bin/sh
 
#
 
#
# example script (../../scripts/rwrapper.sh -> $0)
+
# example wrapper script
  
START="1"
+
START="0"
UPDATEEPG_LOGFILE="/var/log/vdr/updateepg.log"
+
ENTRY=$"0,1:User-defined"
 +
CHECK=$(:)
  
# add this line to your timers.conf:
+
# after recording
# folgende zeile in die timers.conf eintragen:
+
EXECA=""
#
+
# before recording
# 1:S19.2E-1-1116-12732:MDMDFSS:0300:0301:0:1:wakeup:
+
EXECB=""
 +
# edited recording
 +
EXECE=""
  
if [ -z "${2/*\/wakeup\/*/}" ] ; then
+
case $0 in
    (
+
      *after-*) CMD="$EXECA" ;;
for i in ${!EPG_*} ; do
+
    *before-*) CMD="$EXECB" ;;
    eval x=\$$i
+
    *edited-*) CMD="$EXECE" ;;
    if [ $x -eq 1 ] ; then
+
esac
x=`echo ${i##*_} | tr A-Z a-z`
+
 
if [ -x "$ADMDIR/start-cmds/rc/$x" ] ; then
+
if [ -n "$CMD" ] ; then
    date
+
    logit $0 "EXEC -> $CMD $2"
    echo "============================="
+
    screen -dm sh -c "$CMD \"$2\""
    cd "$ADMDIR/start-cmds/rc"
+
    sh $x startnobg
+
    echo
+
fi
+
    fi
+
done
+
date
+
echo "============================="
+
touch "$VDR_CONFIG/plugins/epgsearch/.epgsearchupdate"
+
sleep 30s
+
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
+
    ) > $UPDATEEPG_LOGFILE 2>&1 &
+
 
fi
 
fi
 
</pre>
 
</pre>
}}[[Kategorie:Installscript]]
+
}}
 +
 
 +
 
 +
[[Kategorie:Installscript]]

Aktuelle Version vom 29. September 2008, 08:37 Uhr

Inhaltsverzeichnis

[Bearbeiten] 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)

Oder, auf der Kommandozeile.

shell> $PREFIX/etc/vdr/admin/dialog.sh
kurze beschreibung

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

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

[Bearbeiten] 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="20000"

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


[Bearbeiten] 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"


[Bearbeiten] Bsp ({edited,before,after}-userdev.cmd)

1 = Führt, Benutzerdefinierte Befehle aus, welche in EXEC{B,A,E} hinterlegt werden können.
Datei
../recording-cmds/{edited,before,after}-userdev.cmd
#!/bin/sh
#
# example wrapper script

START="0"
ENTRY=$"0,1:User-defined"
CHECK=$(:)

# after recording
EXECA=""
# before recording
EXECB=""
# edited recording
EXECE=""

case $0 in
      *after-*) CMD="$EXECA" ;;
     *before-*) CMD="$EXECB" ;;
     *edited-*) CMD="$EXECE" ;;
esac

if [ -n "$CMD" ] ; then
    logit $0 "EXEC -> $CMD $2"
    screen -dm sh -c "$CMD \"$2\"" 
fi

{{{2}}}