Rwrapper.sh

Aus VDR Wiki
(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
(+ record.conf)
Zeile 2: Zeile 2:
 
#!/bin/sh
 
#!/bin/sh
 
#
 
#
# rwrapper.sh - v.0.1
+
# rwrapper.sh - v.0.2
 
#
 
#
 
# 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
 +
  RECORD_CNF="/etc/vdr/record.conf"
 +
# CONFIG END
  
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
PATH=$PATH:/usr/local/bin
  
case "$1" in
+
case "${1}" in
     before)
+
     before|after|edited)
        echo "Before recording $2"
+
echo "${1} recording ${2}"
        test -x $SOURCEDIR/clipinc/vdrrecinfo.pl && {
+
VAR=`echo ${1:0:1}|tr a-z A-Z`
            $SOURCEDIR/clipinc/vdrrecinfo.pl "$@"
+
sed "/^${VAR}/!d;s/^[A-Z]://" "${RECORD_CNF}" |
        }
+
while read i ; do
test -x /usr/local/bin/marks2pts && {
+
    eval ${i}
    echo "/usr/local/bin/marks2pts $1 \"$2\"" | at now
+
done
}
+
;;
        ;;
+
    after)
+
        echo "After recording $2"
+
        test -x /usr/local/bin/noad && {
+
            /usr/local/bin/noad nice --background \
+
                                    --jumplogo \
+
                                    --ac3 \
+
                                    --overlap \
+
                                    --OSD \
+
                                    --statisticfile=/var/log/noadstat "$@"
+
        }
+
        ;;
+
    edited)
+
echo "Edited recording ${2}"
+
test -x /usr/local/bin/marks2pts && {
+
    echo "/usr/local/bin/marks2pts -upload $1 \"$2\"" | at now
+
}
+
        ;;
+
 
     *)
 
     *)
        echo "ERROR: unknown state: $2"
+
echo "ERROR: unknown state: ${2}"
        ;;
+
;;
 
esac
 
esac
 
</pre>
 
</pre>
  
 
[[Kategorie:Scripts]]
 
[[Kategorie:Scripts]]

Version vom 11. Dezember 2004, 08:22 Uhr

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