Hallo,
kann mir jemand bezüglich der Runvdr helfen? Ich möchte die Teile entfernt haben, die für das starten des DVB Treiber zuständig sind.
Hintergrund ist, dass ich auf einem anderen PC auch VDR installiert habe und mittels Xine dort nun Fernsehen möchte, ohne DVB-Hardware.
Hier meine Runvdr:
#!/bin/sh
#
# sample runvdr script
DESC="Digital Videorecorder"
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
CONF=/usr/local/src/VDRtmp/vdr.conf
. $CONF
VERSION=`grep -s 'define VDRVERSION' $MYPATH/VDR/config.h | cut -f 2 -d '"'`
test "$VERSION" exit 0
VDRPRG=$MYPATH/VDR/vdr
test -x $VDRPRG exit 0
getconfig()
{
config=`grep =\" $CONF | sed -e 's/=.*//' -e '/^#/d'`
for i in $config ; do
eval x=\$$i
if (echo $i | egrep -q _) ; then
VDROPT=$VDROPT" --`echo "${i##*\_}" | tr A-Z a-z`='$x'"
fi
export $i="$x"
done
}
getplugins()
{
unset PLUGINS ordered_plugins[@] plugins[@]
plugins=( `find $VDR_LIB -name "libvdr-*.so.$VERSION" -printf '%f ' 2>&- | sed "s/libvdr-\([^\.]\+\)\.so\.$VERSION/\1/g"` )
ordered=( `grep -vs ^# $VDR_CONFIG/order.conf` )
plugins=( "${plugins[@]}" )
for i in ${ordered[@]} ; do
for (( line=0 ; line<${#plugins[@]} ; line++ )) ; do
if [ "$i" = "${plugins[$line]}" ] ; then
ordered_plugins=( "${ordered_plugins[@]}" "${plugins[$line]}" )
unset plugins[$line]
plugins=( "${plugins[@]}" )
break
fi
done
done
for i in ${ordered_plugins[@]} ${plugins[@]} ; do
n=`grep -s "^$i " $VDR_CONFIG/plugins.conf`
if [ "$n" ] ; then
PLUGINS=$PLUGINS" -P'$n'"
else
PLUGINS=$PLUGINS" -P$i"
fi
done
}
getcommands()
{
cd $VDR_CONFIG
find ${VDR_LIB%s*} -name "libvdr-*.so.$VERSION" -printf '%f\n' 2>&- \
| sed "s/^libvdr-\(..*\)\.so\.$VERSION$/\1/" | sort \
| awk '{ printf "%-40s%-0s\n" ," |--- "$1,": export LABEL=\""$1"\" ; eval $SET_PLUGINS" }' >commands[2].conf
if ls commands[*\].conf >/dev/null 2>&1 ; then
cat `ls commands[*\].conf` >commands.conf
fi
}
modules()
{
case $1 in
m*) echo "Starting DVB:" ;;
*) echo "Shutting down DVB:" ;;
esac
OLD=$IFS
IFS=$'\t'$'\n'
for i in $MODULES ; do
IFS=$OLD
$1 $i >/dev/null 2>&1
status=$?
case $status in
0) echo "[done] $i" ;;
1) echo "[failed] $i" ;;
esac
IFS=$'\t'$'\n'
done
IFS=$OLD
}
driver()
{
IVMOD=`lsmod | grep -w '^ivtv' | wc -l`
if [ -x $MYPATH/ivtv/utils/runivtv -a $IVMOD -eq 0 ] ; then
sh $MYPATH/ivtv/utils/runivtv
fi
LSMOD=`lsmod | grep -w '^dvb' | wc -l`
if [ $LSMOD -eq 0 ] ; then
if cd $MYPATH/DVB/build-2.$(uname -r | sed -e 's/^2\.\(.\).*/\1/') 2>/dev/null ; then
# = 1.1.1
./insmod.sh load
else
# = 1.0.1
#cd $MYPATH/DVB/driver ; make insmod
modules modprobe
fi
if [ "$SSTIME" -ne 0 ] ; then
echo "Load still image:"
test_stillimage $STILLIMAGE
fi
fi
}
loadlirc()
{
LIRCD=`ps -e | grep -w 'lircd' | wc -l`
if [ $LIRCD -eq 0 ] ; then
lircd &
fi
IREXEC=`ps -e | grep -w 'irexec' | wc -l`
if [ $IREXEC -eq 0 ] ; then
irexec -d $VDR_CONFIG/setup/etc/lircrc.sample
fi
}
setplugins()
{
export SET_PLUGINS="
REAL=\`find ${VDR_LIB%s*} -name \"libvdr-\$LABEL\.so.$VERSION\" -printf '%f\n' 2>&-\` ;
if (echo "$RULES" | egrep -q \"\[\$LABEL\]\") ;
then
echo \"Error plugin \$LABEL is secure !\" ;
elif [ -h $VDR_LIB/\$REAL ] ;
then
if (rm -f $VDR_LIB/\$REAL) ;
then
echo \"\$LABEL = off\" ;
fi ;
else
if (ln -s ${VDR_LIB%s*}/\$REAL $VDR_LIB/\$REAL) ;
then
echo \"\$LABEL = on\" ;
fi ;
fi"
}
getconfig
driver
#loadlirc
setplugins
getcommands
while (true) ; do
CHAN=$(tail -n 300 $SYSLOG | grep 'switching to channel' | tail -n 1 | awk -F channel '{ print $2 }' | tr -d ' ')
if [ -n "${CHAN##*[^0-9,-]*}" -a -e $VDR_CONFIG/setup.conf ] ; then
if [ "$(grep ^CurrendChannel $VDR_CONFIG/setup.conf | awk -F = '{ print $2 }' | tr -d ' ')" != "$CHAN" ] ; then
echo "Edit last channel: `grep -v ^: $VDR_CONFIG/channels.conf | head -n $CHAN | tail -n 1 | cut -f 1 -d :` ..."
sed -i "s/^CurrentChannel = .*$/CurrentChannel = $CHAN/" $VDR_CONFIG/setup.conf
sleep 1
fi
fi
getplugins
echo "Starting $DESC: $VERSION"
su $VDRUSR -c "$VDRPRG $VDROPT $USRDEV $PLUGINS"
if [ $? -eq 0 -o $? -eq 2 ] ; then
exit
fi
date
echo "Restarting $DESC:"
killall -q -TERM $VDRPRG >/dev/null 2>&1
sleep 3
date
if cd $MYPATH/DVB/build-2.$(uname -r | sed -e 's/^2\.\(.\).*/\1/') 2>/dev/null ; then
# = 1.1.1
./insmod.sh reload
else
# = 1.0.1
#cd $MYPATH/DVB/driver ; make rmmod ; make insmod
modules rmmod
modules modprobe
fi
done
Gruß
Mario