Rwrapper.sh

Aus VDR Wiki
(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
K
Zeile 1: Zeile 1:
Wrapper ist geteilt in Script + Konfigurationsdatei, bitte beides an die Bedürfnisse anpassen.
+
{{Box Datei | $PATH/rwrapper.sh |
 +
<pre>
 +
#!/bin/sh
 +
#
 +
# rwrapper.sh
 +
#
 +
# an example script for use with the '-r' option could look like this:
  
#!/bin/sh
+
PATH=$PATH:/usr/local/bin
#
+
# rwrapper.sh - v.0.2
+
#
+
# an example script for use with the '-r' option could look like this:
+
+
# CONFIG START
+
  RECORD_CNF="/etc/vdr/[[record.conf]]"
+
# CONFIG END
+
+
PATH=$PATH:/usr/local/bin
+
+
case "$1" in
+
    before|after|edited)
+
        echo "$1 recording $2"
+
        VAR=`echo ${1:0:1} | tr a-z A-Z`
+
        sed "/^$VAR/!d;s/^[A-Z]://" $RECORD_CNF | while read i ; do
+
            eval $i
+
        done
+
        ;;
+
    *)
+
        echo "ERROR: unknown state: $2"
+
        ;;
+
esac
+
  
 +
case "$1" in
 +
    before)
 +
          echo "Before recording $2"
 +
          noad $1 "$2" --ac3 --overlap --jumplogo --comments --online=1
 +
          vdrrecinfo.pl $1 "$2"
 +
          marks2pts $1 "$2"
 +
          ;;
 +
    after)
 +
          echo "After recording $2"
 +
          nice -n 19 noad $1 "$2" --ac3 --overlap --jumplogo --comments --online=1 --statisticfile=/var/log/noadstat
 +
          ;;
 +
    edited)
 +
          echo "Edited recording $2"
 +
          marks2pts -upload $1 "$2"
 +
          ;;
 +
    *)
 +
          echo "ERROR: unknown state: $1"
 +
          ;;
 +
esac
 +
</pre>
 +
}}
 
[[Kategorie:Scripts]]
 
[[Kategorie:Scripts]]

Version vom 20. Juli 2005, 14:42 Uhr

Datei
$PATH/rwrapper.sh
#!/bin/sh
#
# rwrapper.sh
#
# an example script for use with the '-r' option could look like this:

PATH=$PATH:/usr/local/bin

case "$1" in
    before)
           echo "Before recording $2"
           noad $1 "$2" --ac3 --overlap --jumplogo --comments --online=1
           vdrrecinfo.pl $1 "$2"
           marks2pts $1 "$2"
           ;;
    after)
           echo "After recording $2"
           nice -n 19 noad $1 "$2" --ac3 --overlap --jumplogo --comments --online=1 --statisticfile=/var/log/noadstat
           ;;
    edited)
           echo "Edited recording $2"
           marks2pts -upload $1 "$2"
           ;;
    *)
           echo "ERROR: unknown state: $1"
           ;;
esac