Rwrapper.sh

Aus VDR Wiki
(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
(M)
Zeile 6: Zeile 6:
 
  #
 
  #
 
  # an example script for use with the '-r' option could look like this:
 
  # an example script for use with the '-r' option could look like this:
#
 
# history
 
# --------
 
# 20041207,ronny: added record.conf
 
 
   
 
   
 
  # CONFIG START
 
  # CONFIG START
Zeile 17: Zeile 13:
 
  PATH=$PATH:/usr/local/bin
 
  PATH=$PATH:/usr/local/bin
 
   
 
   
  case "${1}" in
+
  case "$1" in
 
     before|after|edited)
 
     before|after|edited)
         echo "${1} recording ${2}"
+
         echo "$1 recording $2"
 
         VAR=`echo ${1:0:1}|tr a-z A-Z`
 
         VAR=`echo ${1:0:1}|tr a-z A-Z`
 
         sed "/^${VAR}/!d;s/^[A-Z]://" $RECORD_CNF | while read i ; do
 
         sed "/^${VAR}/!d;s/^[A-Z]://" $RECORD_CNF | while read i ; do

Version vom 9. März 2005, 18:09 Uhr

Wrapper ist geteilt in Script + Konfigurationsdatei, bitte beides an die Bedürfnisse anpassen.

#!/bin/sh
#
# 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