summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUdo Richter <udo_richter@gmx.de>2007-02-18 00:00:00 +0100
committerManuel Reimer <manuel.reimer@gmx.de>2013-10-01 17:15:05 +0200
commit6d08550184e9d6d801d67882a827da46fadcdb66 (patch)
treef73739a865dbb707a73ce762b8f4d7b90d7eec9e
parent227b5c30f17596b06ca538eed10631e8ff7c5a66 (diff)
downloadrunvdr-extreme-6d08550184e9d6d801d67882a827da46fadcdb66.tar.gz
runvdr-extreme-6d08550184e9d6d801d67882a827da46fadcdb66.tar.bz2
Version 0.2.0v0.2.0
* New: Pass DVBLOAD and DVBUNLOAD to eval, allows to execute more than one command, thanks to Thomas Büschgens * New: Load ~/.runvdr.conf as default, load /etc/runvdr.conf as fallback * New: INCLUDE directive to load other config file * New: -P "-plugin" drops plugin from plugin load list. Same for -D. * Change: LANGUAGE now sets LC_ALL, not LANG.
-rw-r--r--HISTORY8
-rw-r--r--README48
-rw-r--r--README.de48
-rwxr-xr-xrunvdr83
-rw-r--r--runvdr.conf.example18
5 files changed, 168 insertions, 37 deletions
diff --git a/HISTORY b/HISTORY
index b14bfed..b414bbf 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,6 +1,14 @@
runvdr extreme Revision History
-------------------------------
+2007-02-18: Version 0.2.0
+
+- New: Pass DVBLOAD and DVBUNLOAD to eval, allows to execute more than one
+ command, thanks to Thomas Büschgens
+- New: Load ~/.runvdr.conf as default, load /etc/runvdr.conf as fallback
+- New: INCLUDE directive to load other config file
+- New: -P "-plugin" drops plugin from plugin load list. Same for -D.
+- Change: LANGUAGE now sets LC_ALL, not LANG.
2007-02-03: Version 0.1.1
diff --git a/README b/README
index 04f27c0..a1c9490 100644
--- a/README
+++ b/README
@@ -3,7 +3,7 @@
Written by: Udo Richter <udo_richter(a)gmx.de>
-Project's homepage: http://www.richter-udo.de/vdr/scripts.en.html#runvdr
+Project's homepage: http://www.udo-richter.de/vdr/scripts.en.html#runvdr
See the file COPYING for license information.
@@ -37,11 +37,43 @@ Some of the features of runvdr extreme:
Quick-start
--------------------------------------------------------------------------
- Copy runvdr to /usr/local/bin/ or whereever you like
-- Copy runvdr.conf.example to /etc/runvdr.conf
-- Edit /etc/runvdr.conf to match your needs
+- Copy runvdr.conf.example to /etc/runvdr.conf if you want to run VDR as
+ server, or ~/.runvdr.conf if you want to run it as user.
+- Edit the runvdr.conf to match your needs
-The runvdr.conf is pretty much self-explaining. All options are also available
-on command line, just take a look at runvdr --help.
+The runvdr.conf is pretty much self-explaining. All runvdr.conf options are
+also available on command line, see --help.
+
+
+
+Details
+--------------------------------------------------------------------------
+
+Options take this precedence:
+
+1. Command line options have highest precedence
+2. runvdr.conf file specified by -C or --runvdr-conf
+3. If no -C and no --runvdr-conf specified, use ~/.runvdr.conf
+4. If no -C and no --runvdr-conf and no ~/.runvdr.conf, use /etc/runvdr.conf
+5. If none of the above, runvdr built-in defaults are used.
+
+Only one of the runvdr.conf files is loaded by default, and only one -C
+option is evaluated. However, you can load the contents of another runvdr.conf
+file from a runvdr.conf by using the INCLUDE directive. For example, you can
+load /etc/runvdr.conf from within ~/.runvdr.conf to just override some of
+the settings for the current user.
+
+Plugins added by the AddPlugin directive in the conf file and the --plugin
+and -P command line option can be removed again from the list of plugins
+by specifying "AddPlugin -name", --plugin="-name" or -P-name.
+The name part acts as a pattern to the beginning of the plugin name, all
+plugins matching "name*" will be dropped. Especially "AddPlugin -" and -P- will
+drop all plugins from the list. The same mechanism works for the -D device
+parameter.
+
+To pass parameters to VDR without parsing by runvdr, use -- as paramenter.
+All parameters after -- will be directly passed to VDR. For erxample,
+"runvdr -- --help" will show the command line help of VDR instead of runvdr.
@@ -90,7 +122,7 @@ Dito, but also reload the DVB drivers:
Use the new fresh compiled VDR for the first time:
- runvdr --vdr=/usr/src/vdr-1.4.3/vdr --lib=/usr/src/vdr-1.4.3/PLUGINS/lib
+ runvdr --vdr=/usr/src/vdr-1.5.0/vdr --lib=/usr/src/vdr-1.5.0/PLUGINS/lib
For debugging, start VDR with no terminal redirection:
@@ -104,6 +136,10 @@ Load only the hello plugin:
runvdr -P- -P hello
+Load all plugins, but not the hello-plugin:
+
+ runvdr -P-hello
+
Do a dry-run of runvdr:
runvdr --wrapper=echo
diff --git a/README.de b/README.de
index 65803d8..0417102 100644
--- a/README.de
+++ b/README.de
@@ -1,8 +1,9 @@
runvdr extreme
-Geschrieben von: Udo Richter <udo_richter(a)gmx.de>
-Projekt Homepage: http://www.richter-udo.de/vdr/scripts.html#runvdr
+
+Geschrieben von: Udo Richter <udo_richter(a)gmx.de>
+Projekt Homepage: http://www.udo-richter.de/vdr/scripts.html#runvdr
Siehe Datei COPYING für Lizenz-Informationen
@@ -36,7 +37,9 @@ Einige der Features von runvdr extreme:
Schnellstart
--------------------------------------------------------------------------
- Kopiere runvdr nach /usr/local/bin/ oder wo-auch-immer-du-magst
-- Kopiere runvdr.conf.example nach /etc/runvdr.conf
+- Kopiere runvdr.conf.example nach /etc/runvdr.conf, wenn runvdr als
+ Server laufen soll, oder nach ~/.runvdr.conf, wenn runvdr durch
+ einen Benutzer gestartet werden soll.
- Bearbeite /etc/runvdr.conf nach deinem Bedarf
Die runvdr.conf ist größtenteils selbsterklärend. Alle Optionen sind auch
@@ -44,6 +47,39 @@ per Kommandozeile verfügbar, siehe runvdr --help.
+Details
+--------------------------------------------------------------------------
+
+Die Optionen werden in dieser Reihenfolge ausgewertet:
+
+1. Kommandozeilenoptionen haben höchste Priorität.
+2. runvdr.conf auf Kommandozeile mit -C oder --runvdr-conf angegeben
+3. Wenn kein -C und kein --runvdr-conf angegeben, benutze ~/.runvdr.conf
+4. Wenn kein -C und kein --runvdr-conf un kein ~/.runvdr.conf, benutze
+ /etc/runvdr.conf
+5. Wenn keine der obigen Dateien existiert, benutze runvdr-Defaults
+
+Nur eine runvdr.conf wird normalerweise geladen, und nur eine -C Option
+wird ausgewertet. Man kann aber den Inhalt einer runvdr.conf in einer anderen
+runvdr.conf laden, wenn man die INCLUDE-Direktive verwendet. Man kann zum
+Beispiel /etc/runvdr.conf aus der Datei ~/.runvdr.conf heraus laden, um
+für den aktuellen Benutzer einige Einstellungen zu überschreiben.
+
+Plugins, die durch die AddPlugin-Direktive in der conf-Datei oder die
+--plugin oder -P Option geladen werden, können von der Plugin-Liste wieder
+entfernt werden, wenn man "AddPlugin -name", --plugin="-name" oder -P-name
+verwendet. Der name-Teil wird dabei als Muster für den Anfangsteil des Plugin-
+Namens verwendet, alle Plugins, die auf "name*" passen, werden entfernt.
+Insbesondere hebt "AddPlugin -" und -P- die gesamte bisherige Plugin-Liste
+auf. Der selbe Mechanismus funktioniert auch beim -D Device-Parameter.
+
+Um Parameter an VDR direkt weiter zu geben, ohne dass runvdr sie
+interpretiert, kann -- als Parameter angegeben werden. Alle Parameter nach
+-- werden unverändert an VDR weiter gegeben. So gibt "runvdr -- --help"
+die Hilfestellung von VDR aus, und nicht die Hilfestellung von runvdr.
+
+
+
Voraussetzungen
--------------------------------------------------------------------------
Unix-Kommandos, die runvdr benutzt:
@@ -89,7 +125,7 @@ Dito, aber lade auch die DVB-Treiber neu:
Benutze den frich neu übersetzten VDR zum ersten mal:
- runvdr --vdr=/usr/src/vdr-1.4.3/vdr --lib=/usr/src/vdr-1.4.3/PLUGINS/lib
+ runvdr --vdr=/usr/src/vdr-1.5.0/vdr --lib=/usr/src/vdr-1.5.0/PLUGINS/lib
Zum Debuggen, starte VDR ohne Terminalumlenkung:
@@ -103,6 +139,10 @@ Lade nur das hello-Plugin:
runvdr -P- -P hello
+Lade alle Plugins, aber nicht das hello-Plugin:
+
+ runvdr -P-hello
+
Starte einen Testlauf von runvdr, um zu sehen was passiert:
runvdr --wrapper=echo
diff --git a/runvdr b/runvdr
index d46f81b..1d895b7 100755
--- a/runvdr
+++ b/runvdr
@@ -8,7 +8,7 @@
# http://www.richter-udo.de/vdr/scripts.html#runvdr
#
-RUNVDRCONF=/etc/runvdr.conf
+RUNVDRCONF=""
# Some unix commands being used:
@@ -164,10 +164,19 @@ function Clean() {
# Helper functions
function AddPluginString() {
# add $1 as plugin
- if [ "$1" == "-" ] ; then
+
+ if [ -n "$1" -a -z "${1##-*}" ] ; then
+ local pattern="${1#-}*"
+
+ local -a plugins1
+ plugins1=("${PLUGINS[@]}")
PLUGINS=()
+
+ for i in "${plugins1[@]}" ; do
+ [ -n "${i##$pattern}" ] && PLUGINS[${#PLUGINS[*]}]="$i";
+ done
else
- PLUGINS[${#PLUGINS[*]}]="$*"
+ [ -n "$1" ] && PLUGINS[${#PLUGINS[*]}]="$1";
fi
}
function AddPlugin() {
@@ -195,24 +204,51 @@ function AddPlugin() {
AddPluginString "$plugin"
}
function AddDevice() {
- if [ "$1" == "-" ] ; then
+ if [ -n "$1" -a -z "${1##-*}" ] ; then
+ local pattern="${1#-}*"
+
+ local -a devices1
+ devices1=("${DVBDEVICE[@]}")
DVBDEVICE=()
+
+ for i in "${devices1[@]}" ; do
+ [ -n "${i##$pattern}" ] && DVBDEVICE[${#DVBDEVICE[*]}]="$i";
+ done
else
- DVBDEVICE[${#DVBDEVICE[*]}]="$*";
+ [ -n "$1" ] && DVBDEVICE[${#DVBDEVICE[*]}]="$1";
fi
}
+function INCLUDE() {
+ # include different conf file
+ if [ -n "$1" ] ; then
+ if [ -r "$1" ] ; then
+ . "$1" || exit 1
+ else
+ echo "runvdr: $1 not found." >&2
+ fi
+ fi
+}
+
function LoadConfFile() {
# Load configuration file
- if [ -r $RUNVDRCONF ] ; then
- . $RUNVDRCONF || exit 1
- else
- echo "runvdr: $RUNVDRCONF not found." >&2
+ if [ -z "$RUNVDRCONF" -a -r ~/.runvdr.conf ] ; then
+ RUNVDRCONF=~/.runvdr.conf
fi
-
+ if [ -z "$RUNVDRCONF" -a -r /etc/runvdr.conf ] ; then
+ RUNVDRCONF=/etc/runvdr.conf
+ fi
+ if [ -n "$RUNVDRCONF" ] ; then
+ if [ -r "$RUNVDRCONF" ] ; then
+ . "$RUNVDRCONF" || exit 1
+ else
+ echo "runvdr: $RUNVDRCONF not found." >&2
+ fi
+ fi
+
# Transform some defaults, so empty parameters can have a
# non-default meaning
[ -z "$LIRC" ] && LIRC=0
@@ -327,6 +363,7 @@ Parsed VDR options:
-d --daemon run in daemon mode
-D # --device=# use only the given DVB device (NUM = 0, 1, 2...)
Use '-' to override devices from config file
+ Use '-x' to ignore device x from config file
-E # --epgfile=# write the EPG data into the given FILE. - to disable.
-g # --grab=# write images from the SVDRP command GRAB into the given DIR
-L # --lib=# search for plugins in DIR
@@ -335,7 +372,8 @@ Parsed VDR options:
-m --mute mute audio of the primary DVB device at startup
--no-kbd don't use the keyboard as an input device
-P # --plugin=# load a plugin defined by the given options
- Use '-' to ignore plugins from config file
+ Use '-' to ignore all plugins from config file
+ Use '-xx' to ignore plugin xx from config file
-p # --port=# use PORT for SVDRP
--rcu[=#] use a remote control device, attached to PATH
-r # --record=# call CMD before and after a recording
@@ -369,8 +407,8 @@ function BuildCommand() {
[ -n "$CONFIGDIR" ] && VDRCMD="$VDRCMD -c \"$CONFIGDIR\""
[ -n "$DAEMON" ] && VDRCMD="$VDRCMD -d"
- for ((i=0;i<${#DVBDEVICE[*]};i++)) ; do
- [ -n "${DVBDEVICE[i]}" ] && VDRCMD="$VDRCMD -D ${DVBDEVICE[i]}"
+ for i in "${DVBDEVICE[@]}" ; do
+ [ -n "$i" ] && VDRCMD="$VDRCMD -D $i"
done
[ -n "$EPGFILE" ] && VDRCMD="$VDRCMD -E \"$EPGFILE\""
@@ -386,8 +424,7 @@ function BuildCommand() {
[ -n "$NOKBD" ] && VDRCMD="$VDRCMD --no-kbd"
[ -n "$SVDRPPORT" ] && VDRCMD="$VDRCMD -p $SVDRPPORT"
- for ((i=0;i<${#PLUGINS[*]};i++)) ; do
- p="${PLUGINS[i]}"
+ for p in "${PLUGINS[@]}" ; do
if [ -n "$p" ] ; then
# do some shell quoting
p="${p//'\'/\\\\}"
@@ -495,7 +532,7 @@ if [ -n "$HELP" ] ; then
fi
if [ -n "$VERSION" ] ; then
- echo "runvdr version 0.1.1"
+ echo "runvdr version 0.2.0"
exit 0
fi
@@ -559,8 +596,8 @@ BuildCommand || exit 1
[ -n "$SWITCHTERMINAL" ] && $CHVT $SWITCHTERMINAL
if [ -n "$LANGUAGE" ] ; then
- LANG="$LANGUAGE"
- export LANG
+ LC_ALL="$LANGUAGE"
+ export LC_ALL
fi
# Remember PID of this process
@@ -576,7 +613,7 @@ fi
# Load driver if it hasn't been loaded already:
-$DVBLOAD
+eval "$DVBLOAD"
# Count how often VDR terminated very quickly
SHORTRUNTIMES=0
@@ -651,8 +688,8 @@ while (true) do
WaitKill $PID $VDRPRG $TERMTIMEOUT $KILLTIMEOUT
# reload DVB stuff
- $DVBUNLOAD
- $DVBLOAD
+ eval "$DVBUNLOAD"
+ eval "$DVBLOAD"
;;
*) # Non-signal termination
if [ $RET -eq 0 -o $RET -eq 2 ] ; then
@@ -679,8 +716,8 @@ while (true) do
WaitKill $PID $VDRPRG $TERMTIMEOUT $KILLTIMEOUT
# reload DVB
- $DVBUNLOAD
- $DVBLOAD
+ eval "$DVBUNLOAD"
+ eval "$DVBLOAD"
# and loop
;;
diff --git a/runvdr.conf.example b/runvdr.conf.example
index b06572a..85dc41b 100644
--- a/runvdr.conf.example
+++ b/runvdr.conf.example
@@ -3,10 +3,19 @@
# Sample configuration file for the runvdr vdr-launcher script.
#
# by Udo Richter <udo_richter(a)gmx.de>
-# http://www.richter-udo.de/vdr/scripts.html#runvdr
+# http://www.udo-richter.de/vdr/scripts.html#runvdr
#
#
+
+# Include other configuration file for defaults
+# Must be first, or will override all previous settings
+# You may want to use this in ~/.runvdr.conf if you also want to load
+# /etc/runvdr.conf. DO NOT create infinite loops with this!
+#
+# INCLUDE /etc/runvdr.conf
+
+
##### -------------------------
##### Common config options
##### -------------------------
@@ -17,11 +26,11 @@ VDRPRG="/usr/local/bin/vdr"
# Command to load the DVB drivers
# DVBLOAD will be launched before VDR starts and whenever the drivers
# need to be reloaded.
-DVBLOAD=""
+DVBLOAD=''
# Command to unload the DVB drivers
# DVBUNLOAD will be launched whenever the drivers need to be reloaded.
-DVBUNLOAD=""
+DVBUNLOAD=''
# Use VIDEODIR as video directory. The default is /video.
VIDEODIR="/video"
@@ -46,7 +55,7 @@ CONFIGDIR="/video"
# which would load a plugin named "hello", giving it the three
# command line options "-b", "-a" and "A B C"
#
-# Note: Using the command line option --plugin requires additional
+# Note: Using the command line option --plugin and -P requires additional
# quoting. The corresponding command line would be:
#
# runvdr --plugin "hello -b -a \"A B C\""
@@ -137,6 +146,7 @@ RCU=
VFAT=
# Store PID of runvdr into a file?
+# RUNVDRPID=~/.runvdr.pid
RUNVDRPID=/var/run/runvdr.pid
# Set the controlling terminal. For example, /dev/tty8