3 # runvdr - VDR launcher
5 # runvdr [VDROPTION]...
7 shopt -s extglob nocasematch nullglob
10 PLUGINDIR
=/usr
/lib
/vdr
11 PLUGINVER
=VDR_PLUGIN_VERSION
12 PLUGINSUF
=${PLUGINVER:+.$PLUGINVER}
16 type -P logger
&>/dev
/null
&& \
17 logger
-s -p daemon.info
-t ${0##*/} "$1" 2>&1 ||
echo "INFO: $1"
22 local plugin
=$1 PLUGIN_OPTIONS
= PLUGIN_ENABLED
=
23 if [[ -e /etc
/sysconfig
/vdr-plugins.d
/$plugin.conf
]] ; then
24 .
/etc
/sysconfig
/vdr-plugins.d
/$plugin.conf
25 case $PLUGIN_ENABLED in no|false|
0) return ;; esac
27 if [[ $PLUGIN_OPTIONS ]] ; then
28 VDR_OPTIONS
+=( --plugin="$plugin $PLUGIN_OPTIONS" )
30 VDR_OPTIONS
+=( --plugin=$plugin )
37 # Add "priority" plugins.
38 for plugin
in $VDR_PLUGIN_ORDER ; do
39 [[ -e $PLUGINDIR/libvdr-
${plugin}.so
$PLUGINSUF ]] && plugconf
$plugin
41 # Add the rest available.
42 for plugin
in $PLUGINDIR/libvdr-
*.so
$PLUGINSUF ; do
43 plugin
=${plugin##*/libvdr-}
44 plugin
=${plugin%.so$PLUGINSUF}
45 for p
in $VDR_PLUGIN_ORDER ; do
46 if [[ $plugin == $p ]] ; then
57 local modules
=$
( /sbin
/lsmod | \
58 awk '/^dvb_core/ { gsub(","," ",$4) ; print $4 }' )
59 if [[ $modules ]] ; then
60 log
"Reloading DVB modules"
61 /sbin
/modprobe
-r $modules dvb_core
62 for module
in $modules ; do
63 /sbin
/modprobe
$module
71 [[ -f /etc
/sysconfig
/vdr
]] && .
/etc
/sysconfig
/vdr
72 [[ $DAEMON_COREFILE_LIMIT ]] && \
73 ulimit -S -c $DAEMON_COREFILE_LIMIT &>/dev
/null
&& \
74 VDR_OPTIONS
+=( --userdump ) && cd ${TMPDIR:-/tmp}
77 $VDR "$@" "${VDR_OPTIONS[@]}"
80 # 137: "kill -KILL" eg in killproc(), others: "man vdr"
83 log
"VDR exited with status $rc, exiting"
87 log
"VDR exited with status $rc, attempting restart"
88 case $RELOAD_DVB in yes|true|
1) reload_dvb
;; esac