Rwrapper.sh

Aus VDR Wiki
(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
Zeile 1: Zeile 1:
 
Wrapper ist geteilt in Script + Konfigurationsdatei, bitte beides an die Bedürfnisse anpassen.
 
Wrapper ist geteilt in Script + Konfigurationsdatei, bitte beides an die Bedürfnisse anpassen.
  
  RECORD_CNF="/etc/vdr/[[record.conf]]"
+
  #!/bin/sh
 
+
#
<pre>
+
# rwrapper.sh - v.0.2
#!/bin/sh
+
#
#
+
# an example script for use with the '-r' option could look like this:
# rwrapper.sh - v.0.2
+
#
#
+
# history
# an example script for use with the '-r' option could look like this:
+
# --------
#
+
# 20041207,ronny: added record.conf
# history
+
# --------
+
# CONFIG START
# 20041207,ronny: added record.conf
+
  RECORD_CNF="/etc/vdr/[[record.conf]]"
 
+
# CONFIG END
# CONFIG START
+
  RECORD_CNF="/etc/vdr/record.conf"
+
PATH=$PATH:/usr/local/bin
# CONFIG END
+
 
+
case "${1}" in
PATH=$PATH:/usr/local/bin
+
 
+
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}" |
+
        sed "/^${VAR}/!d;s/^[A-Z]://" "${RECORD_CNF}" |
while read i ; do
+
        while read i ; do
    eval ${i}
+
            eval ${i}
done
+
        done
;;
+
        ;;
 
     *)
 
     *)
echo "ERROR: unknown state: ${2}"
+
        echo "ERROR: unknown state: ${2}"
;;
+
        ;;
esac
+
esac
</pre>
+
 
  
 
[[Kategorie:Scripts]]
 
[[Kategorie:Scripts]]

Version vom 24. Dezember 2004, 13:21 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:
#
# history
# --------
# 20041207,ronny: added record.conf

# 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