Hi,
is there anyone who develops a plugin to control the plugins in runvdr. It would be nice to switch the plugins on and off from inside vdr, and i think you can do it, if you write a plugin to change the commandline of runvdr.
any hints - Thanks
Hi,
is there anyone who develops a plugin to control the plugins in runvdr. It would be nice to switch the plugins on and off from inside vdr, and i think you can do it, if you write a plugin to change the commandline of runvdr.
any hints - Thanks
Hi,
i dont see any reason for such a plugin
Btw. its too difficult.
Otherwise you must have a magic glasseye in your pc , so
that the plugin knows your configuration (path , etc..commandline parameters , etc.).
Btw. you will not do that often , so if you dont have a monitor/TV-out connected, install the console-plugin
and a dirty editor where you can un-/comment the
plugins and restart vdr from your commands.
Maybe you have to change your runvdr to do that
easily.
I think thats it and dont bloated vdr.
I mean someone use vdr in this ... , the other on
that way (e.g Path to mount.sh ..etc)
bye
thanks a lot, thats looks very interesting
hi,
by myself i see even no use of runvdr. it is a quick and dirty script to start vdr. in my opinion someone should write a clean init script and thats it.
only my 2 cent
regards mad
ZitatAlles anzeigenOriginal von mad
hi,
by myself i see even no use of runvdr. it is a quick and dirty script to start vdr. in my opinion someone should write a clean init script and thats it.
only my 2 cent
regards mad
mad mal in German :-))
quick = richtig, hat nicht lange gedauert, irgendwo muß man ja anfangen.
dirty = egal, es funktioniert somit es es mir herzlich wurscht, klar geht das auch über init bei linux geht bekanntlich alles, nur glaubst Du es kann damit wer was anfangen wenn man 10 Scripts postet? Bei den fragen die hier manchmal so gestellt werden.
So wie es oben steht ist es eh nicht komplett, um ein Plugin (on|off) zu realisieren gehört sicher nen bischen mehr dazu, ich Denke da an die ganzen entrys in der setup.conf die müßten nebenbei auch noch gecleant werden, bevor neu geladen wird, sonnst müllt es Dir so oder so den log zu.
Ob nun per init oder so wie oben ist wie gesagt egal.
- backup setup.conf erstellen?
- wenn plugin auf (off) gesetzt wird setup.sh säubern?
- wenn plugin auf (on) gesetzt wird setup.sh wieder neu beschreiben?
bei den unmengen an entrys wirst Du schon eine ecke lang sitzen um das sauber hinzubekommen, oder willst Du jedesmal eine "nackte" setup.conf laden? Um dann alles neu einzustellen?
Morone hat es schon sauber ausgedrückt, wenn man mal die ML verfolgt ist es eh mal geplannt, bis dato muß man sich halt selbst irgendwie behelfen.
habe nur den einfachsten weg gepostet, es geht sicher auch komplizierter siehe oben ... nur zu :-)), man sollte aber nutzen und Aufwand vergleichen.
here is a litte bug, the plugins have more options (-m|-r):
if (echo `grep "$1 -m" ${VDRCONF}` | egrep -q '\-P') || (echo `grep "$1 -r" ${VDRCONF}` | egrep -q '\-P')
then
perl -pi -e "s/-P'$1/'$1/" ${VDRCONF}
else
perl -pi -e "s/'$1/-P'$1/" ${VDRCONF}
fi
better e.g
if (echo $(grep "'$1 -[A-Za-z]" ${VDRCONF}) | egrep -q '\-P')
then
perl -pi -e "s/-P'$1/'$1/" ${VDRCONF}
else
perl -pi -e "s/'$1/-P'$1/" ${VDRCONF}
fi
by
Well if you want to develop such a script,
i micht allready ask for _some_ features:
detect where all my software is and which hardware config i use
(vdr,dvbdriver,soundcard driver and 5.1 analog setup,lirc_hwmodule,lircd,irexec,hdpram tunig for hdds(detect them) and cd's and dvd's(detect),helper modules nvram+cdfs)
and their config files
(vdr-conf-folder,emu10k1.conf,lirc.conf,.lircrc.conf)
and my plugins
(mp3,mplayer,dvd,vcd,console,vdrc,tetris,image,scanner)
and their config/helpers
(image.conf,mp3sources.conf,mplayersources.conf,imagesources.conf,
mount.sh,convert.sh)
which i want and dont want (brainreader?)
not to mention that a good init script also would have to deal with
the user and his mistakes (ask jha about his experience with the mplayer.sh) so for example check if the keys used for irexec dont interfere with vdr or mplayers mappings of keys.
of course i'm kidding, but your demand for a init script is
quite a huge project, because where would one draw the line.
what is the purpose of a init script ?
to work better than the user could do.
even today i have not seen a single init script that coped with all needs, nowhere ..........
Regards MeMeD
memed: hey, so you have your own runsamba, runapache and runnetwork script? Every daemon has its own config and every user has another way to use the software. An init script starts the daemon (vdr) and that with a userdefined configuration ( if you prefer suse i would say rc.config ). Take a look at the gentoo init script, that does the job pretty well. And no script should deal with the users faults, i dont know any init scipt that says "Hey user, your config entry xy is wrong and zz makes no sense together with yx". That's what rtfm is for.
@anonymou: mir gings um runvdr, nicht um die möglichkeit plugins zur laufzeit zu laden, was ja eigendlich nicht möglich ist da es immer ein vdr restart ist ( *würg* ). Da ist Klaus gefragt sowas einzubauen. Da alle Plugins mit Prefix im Configfile arbeiten sollte es gar kein problem sein das zu filtern. Desweiteren stören einträge auch nicht geladener plugins nicht, von daher kann die konfig auch so bleiben wie sie ist. gar kein filtern.
regards mad
da es immer ein vdr restart ist ( *würg* ).
weiß zwar nicht was das (*würg*) bedeuten soll, aber Du hast es doch schon selbst gesagt.
Zitat:
Da ist Klaus gefragt sowas einzubauen.
Das Angebot steht jedenfalls noch, lass mal Deine Idee hören, wie es ohne nen "vdr restart" im jetztiegen Stadium gehen soll? Da brauchst Du mir auch nicht mit init kommen, im Forum liegen einige init scripts, die meisten davon schieben die runvdr auch nur in den Hintergrund, was solls? Kann sich doch jeder anpassen wie er lustig ist.
Schon mal drüber nachgedacht warum im Head steht:
Simple Script, naja und mal so nebenbei habe ich selbst gar keinen bedarf Plugins on bzw off zu setzen, hatte es nur mal hier gelesen.
by
update:
commands.conf, e.g:
========================================================
--+ p l u g i n s : echo 'No function, this is a Seperator ?'
|--- Load vdr new : /path/to/change.sh /path/to/runvdr.conf loadnew
|--- runvdr.conf.org > runvdr.conf : /path/to/change.sh /path/to/runvdr.conf loadorg
|--- View runvdr.conf entrys : /path/to/change.sh /path/to/runvdr.conf view
|--- analogtv : /path/to/change.sh /path/to/runvdr.conf analogtv
|--- joystick : /path/to/change.sh /path/to/runvdr.conf joystick
............
--+ b o o t s c r e e n : echo 'No function, this is a Seperator ?'
|--- Set on : perl -pi -e "s/ SSTIME.*/ SSTIME='3'/" /usr/local/src/VDR/runvdr && grep ' SSTIME' /usr/local/src/VDR/runvdr
|--- Set off : perl -pi -e "s/ SSTIME.*/ SSTIME='0'/" /usr/local/src/VDR/runvdr && grep ' SSTIME' /usr/local/src/VDR/runvdr
............
Alles anzeigen
chance.sh, e.g:
========================================================
#!/bin/sh
#
# sample script, set plugins on/off via commands.conf
if test $# -ne 2 ; then
clear
echo "Usage : $0 /path/to/runvdr.conf plugin plugin entry on/off"
echo "or : $0 /path/to/runvdr.conf view show runvdr.conf entries"
echo "or : $0 /path/to/runvdr.conf loadorg runvdr.conf.org > runvdr.conf"
echo "or : $0 /path/to/runvdr.conf loadnew start vdr new, root with atd / user killall -9 vdr"
echo
echo "Example : $0 /usr/local/src/VDR/runvdr.conf dvd"
echo
exit 128
else
mypath=`echo $1 | sed -e 's/\/runvdr.conf//'`
fi
if ! test -e "$1" ; then
echo "Error $1 not found !"
exit 128
fi
function ShowCmd ()
{
(
grep -v ^-P $1 | sed -e '1d' -e '$d' -e "s/^'//" | awk '{ print "off -> "$1 }'
grep ^-P $1 | sed -e 's/^...//' | awk '{ print "on -> "$1 }'
) | sort -t'-' +1
}
case "$2" in
view)
ShowCmd $1
;;
loadorg)
if test -e $1.org ; then
cat $1.org > $1
ShowCmd $1
else
echo "Error $1.org not found !"
fi
;;
loadnew)
if grep -qs ^VDRUSR="root" $mypath/runvdr ; then
if (pidof atd >/dev/null) ; then
echo "clear ; killall -9 vdr ; killall -9 runvdr ; $mypath/runvdr" | at now
else
killall -9 vdr
fi
else
killall -9 vdr
fi
;;
*)
if ! (ls $mypath/PLUGINS/lib/*-$2.* >/dev/null 2>&1) ; then
echo "Error plugin $2 not exist, abort !"
exit 128
elif (grep "$2 [\]" $1 | egrep -q ^-) ; then
perl -pi -e "s/-P $2 \\/ $2 \\/" $1
else
perl -pi -e "s/ $2 \\/-P $2 \\/" $1
fi
if (echo $(grep "'$2 -[A-Za-z]" $1) | egrep -q ^-) ; then
perl -pi -e "s/-P'$2 /'$2 /" $1
else
perl -pi -e "s/'$2 /-P'$2 /" $1
fi
if ! (head -1 $1 | egrep -q VDRCMD) ; then
cat $1.org > $1
echo "Errors, load the orginal runvdr.conf !"
echo
fi
ShowCmd $1
;;
esac
Alles anzeigen
runvdr -> ../VDR/runvdr, e.g:
========================================================
#!/bin/sh
# runvdr: Loads the DVB driver and runs VDR
#
# If VDR exits abnormally, the driver will be reloaded
# and VDR restarted.
#
# Set the environment variable VDRUSR to the user id you
# want VDR to run with. If VDRUSR is not set, VDR will run
# as 'root', which is not necessarily advisable.
#
# Since this script loads the DVB driver, it must be started
# as user 'root'.
#
# Any command line parameters will be passed on to the
# actual 'vdr' program.
#
# See the main source file 'vdr.c' for copyright information and
# how to reach the author.
#
# $Id: runvdr 1.11 2003/08/26 16:15:41 kls Exp $
# Modifikations by runvdr.func Wed Dec 10 12:21:23 CET 2003 $
DESC="Digital Videorecorder"
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# user (root / vdr)
VDRUSR="root"
# path to VDR/DVB
MYPATH="/usr/local/src"
# directory where vdr stores its config files. vdr defaults to /video
VDR_CONFIG="/usr/local/src/VDRtmp"
# write the EPG data into the given FILE (default is /video/epg.data)
# use '-E-' to disable this if FILE is a directory, the default EPG file will be created in that directory
VDR_EPG="$VDR_CONFIG/VDRtmp/epg.data"
# write EPG data in a RAMDRIVE
# ---------- /etc/fstab ----------
# none /tmp tmpfs size=32m 0 0
# --------------------------------
#if test -f /etc/epg.data ; then
# cp -fu /etc/epg.data $EPGFILE
#fi
# call CMD to shutdown the computer
VDR_SHUTDOWN="$VDR_CONFIG/scripts/vdrshutdown"
# activate the watchdog timer with a timeout of SEC
# seconds (default: 0); '0' disables the watchdog
VDR_WATCHDOG="60"
# controlling tty
VDR_TERMINAL="/dev/tty8"
# which port to listen vor SVDRP commands, see vdr --help. default (default: 2001)
VDR_PORT=
# search for plugins in DIR (default is ./PLUGINS/lib)
VDR_LIB="$MYPATH/VDR/PLUGINS/lib"
# amount of log messages, see vdr --help. default empty
VDR_LOG=
# call CMD before and after a recording, e.g: /usr/local/bin/noad --statisticfile=/video/noadstat
VDR_RECORD=
# use DIR as video directory (default: /video)
VDR_VIDEO=
# send Dolby Digital audio to stdin of command CMD
VDR_AUDIO=
# use only the given DVB device (NUM = 0, 1, 2...)
# there may be several -D options (default: all DVB devices will be used)
VDR_DEV=
# mish ... e.g: "--mute --daemon"
USRDEV=
# display the image <n> seconds, no splash set it to "0"
export SSTIME="0"
# videodev than the first (still image)
export DEVICE="/dev/dvb/adapter0/video0"
# path to still image
STILLIMAGE="$VDR_CONFIG/boot/logo-fb"
# for read the last channel
SYSLOG="/var/log/messages"
# unloading / loads the following modules
MODULES="dvb-core \
dvb-ttpci \
ves1820 \
stv0299 \
grundig_29504-491 \
grundig_29504-401 \
alps_tdlb7 \
alps_tdmb7 \
alps_bsrv2 \
tda1004x"
vdropt ()
{
echo " $USRDEV"
for opt in `grep ^VDR_ $MYPATH/VDR/runvdr | cut -f 1 -d =`
do
eval get=\$$opt
if test "$get" ; then
echo " --`echo "${opt##*\_}" | tr A-Z a-z`='$get'"
fi
done
}
driver ()
{
if test "$1" = modprobe ; then
echo "Starting DVB:"
else
echo "Shutting down DVB:"
fi
for i in $MODULES
do
if ($1 $i 2>/dev/null) ; then
printf "%-60s%-0s\n" "$i" "`echo -e "\E[32m\033[1mdone"`"
else
printf "%-60s%-0s\n" "$i" "`echo -e "\E[31m\033[1mfailed"`"
fi
tput sgr0
done
}
# load driver if it hasn't been loaded already:
if test $(lsmod | grep -cw '^dvb') -eq 0 ; then
#cd $MYPATH/DVB/driver; make insmod
driver modprobe
if test "$SSTIME" -ne 0 ; then
echo "Load still image:"
$MYPATH/DVB/apps/test/test_stillimage $STILLIMAGE
fi
fi
while (true)
do
CHAN=$(tail -n 300 $SYSLOG | grep 'switching to channel' | tail -n 1 | awk -F 'channel' '{ print $2 }' | sed -e 's/ //g')
if test -n "${CHAN##*[^0-9,-]*}" -a -e $VDR_CONFIG/setup.conf ; then
if test "$(grep "^CurrendChannel" $VDR_CONFIG/setup.conf | awk -F '=' '{ print $2 }' | sed -e 's/ //g')" != "$CHAN" ; then
echo "Edit last Channel ($CHAN) ..."
perl -pi -e "s/^CurrentChannel = .*$/CurrentChannel = $CHAN/" $VDR_CONFIG/setup.conf
sleep 1
fi
fi
echo "Starting $DESC:"
. $MYPATH/VDR/runvdr.conf
su -c "$VDRCMD" $VDRUSR
if test $? -eq 0 -o $? -eq 2 ; then
exit
fi
date
echo "Restarting $DESC:"
killall -q -TERM $VDRPRG >/dev/null 2>&1
sleep 3
#cd $MYPATH/DVB/driver ; make rmmod ; make insmod
driver rmmod ; driver modprobe
date
done
Alles anzeigen
runvdr.conf -> ../VDR/runvdr.conf, e.g:
========================================================
VDRCMD="$MYPATH/VDR/vdr $(echo `vdropt`) \
analogtv \
'joystick -d /dev/js1' \
mailbox \
mediamvp \
-P'powermate -d /dev/input/event0' \
-P'sleeptimer -e /usr/local/src/VDRtmp/scripts/sleeptimer.sh' \
-P statusleds \
"
runvdr.conf.org -> ../VDR/runvdr.conf.org, e.g:
========================================================
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!