/usr/sbin/runvdr is in vdr 2.0.3-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | #!/bin/sh
. /usr/lib/vdr/config-loader.sh
VDR_ENV="LANG=$VDR_LANG LC_ALL=$VDR_LANG"
if [ -n "$VDR_CHARSET_OVERRIDE" ] ; then
VDR_ENV="$VDR_ENV VDR_CHARSET_OVERRIDE=$VDR_CHARSET_OVERRIDE"
fi
VDRCMD="$VDR_ENV /usr/bin/vdr $*"
get_modulenames()
{
MODULES=`lsmod | awk '/^dvb/ {gsub(/,/,"\n", $4); print $4}' | uniq | tac | grep -v "^$"`
[ "$MODULES" ] && MODULES="$MODULES dvb_core"
}
# TODO: check if udev handles this on newer systems!?
set_permissions()
{
if [ "$USER" -o "$GROUP" ]; then
for FILE in av7110_ir budget_ci_ir; do
if [ -e "/proc/$FILE" ]; then
chown $USER.$GROUP /proc/$FILE
chmod +r /proc/$FILE
fi
done
fi
chmod o+r /dev/input/event*
}
load_dvb_modules()
{
if modprobe dvb >/dev/null 2>&1 ; then
get_modulenames
else
if [ "$MODULES" ]; then
for MODULE in $MODULES; do
modprobe $MODULE >/dev/null 2>&1
done
else
modprobe dvb_ttpci >/dev/null 2>&1
get_modulenames
fi
wait `pidof udev`
fi
sleep 15
}
unload_dvb_modules()
{
for MODULE in $MODULES; do
rmmod $MODULE >/dev/null 2>&1
wait `pidof rmmod`
done
}
VDR_ERR=`mktemp -p /tmp vdr-err.XXXXXX`
get_modulenames
[ -z "$MODULES" ] && load_dvb_modules
while (true) do
set_permissions
eval $VDRCMD >/dev/null 2>"$VDR_ERR"
case $? in
0)
exit
;;
2)
ERROR=`cat "$VDR_ERR"`
logger -t runvdr "stopping after fatal fail ($ERROR)"
exit
;;
esac
logger -t runvdr "restarting VDR"
killall -q -TERM /usr/bin/vdr
wait `pidof vdr`
unload_dvb_modules
sleep 2
load_dvb_modules
done
|