Hallo,
nachdem ich mein neues board durch guess-helper und den fleissigen Helfern hieir aus dem Forum zu NVRAM überreden konnte, steht jetzt wieder die Feinarbeit in der vdrshutdown an. Um EPG-Daten und Autotimer zu aktualisiern habe ich folgende vdrshutdown mit script hier aus dem Forum im Einsatz.
ZitatAlles anzeigen#!/bin/bash
# $Id: vdrshutdown,v 1.15 2003/08/06 12:55:44 bistr-o-math Exp $
. /etc/vdr/sysconfig
-c "hwclock -w"
cp /ramdisk/epg.data /video0
if [ x$LCD = x"graphlcd" ]; then
/etc/vdr/plugins/graphlcd/stop/starte.sh
fi
NVRAMCMD=/usr/bin/nvram-wakeup
SVDRPCMD=/usr/bin/svdrpsend.pl
CHECKSCRIPT=
#################
## if the script $CHECKSCRIPT thinks that we should shutdown,
## it must not pint anything on stdout.
## if it thinks that we should NOT shutdown,
## it must pint a one-line message on stdout.
##
## note that all parameters passed to vdrshutdown will also be passed to $CHECKSCRIPT
## so it might use them (e.g. $5 -eq 0 below)
##
## it might look like this:
## --------------------------
## #!/bin/bash
##
## pgrep 2divx && { echo Divx-Conversion is still running; exit; }
##
## test -a /some/file && { echo /some/file exists; exit; }
##
## USERCOUNT=`who --count | grep users= | cut -f 2 -d "="`;
## test $5 -eq 0 -a $USERCOUNT -gt 0 && { echo "$USERCOUNT users are logged in."; exit; }
##
## --------------------------
##
## now if $CHECKSCRIPT exists and is executable, the message will be passed through
## SVDRP to the tv screen.
##
#test -x $CHECKSCRIPT && {
# msg=`$CHECKSCRIPT $*`
# test "$msg" != "" && {
# $SVDRPCMD MESG $msg &
# exit 1
# }
#}
#################
# Add here needed options like --configfile=...
# (read man nvram-wakeup and man nvram-wakeup.conf for more details)
#$NVRAMCMD --directisa --settime $1
#$NVRAMCMD --configfile=/etc/nvram-wakeup.conf --directisa --settime $1
# die Uhrzeit fuer den naechsten timer wurde in $1 uebermittelt.
timer=$1
# wann ist das naechste mal 3 Uhr nachts?
night=`date -d "03:00" +%s`
[ $night -lt `date +%s` ] && night=$(( $night + 24*60*60 ))
# was kommt zuerst: der naechste timer oder drei uhr nachts?
[ $night -lt $timer ] && boottime=$night boottime=$timer
[ $boottime -eq 0 ] && boottime=$night
$NVRAMCMD --configfile=/etc/nvram-wakeup.conf --directisa --settime $boottime
case $PIPESTATUS in
0) # all went ok - new date and time set
# /usr/bin/stopvdr
/bin/busybox poweroff
# shutdown -h now
EXITSTATUS=0
;;
1) # all went ok - new date and time set.
#
# *** but we need to reboot. ***
#
# for some boards this is needed after every change.
#
# for some other boards, we only need this after changing the
# status flag, i.e. from enabled to disabled or the other way.
# For plan A - (Plan A is not supported anymore---see README)
#
# For plan B - (don't forget to install the modified kernel image first)
#
# Für ASRock aktivieren
touch /etc/vdr/nvram
# Für andere aktivieren
#lilo -R PowerOff
#reboot
# shutdown -r now
EXITSTATUS=0
;;
2) # something went wrong
# don't do anything - just exit with status 1
EXITSTATUS=1
;;
esac
# exit with 0 if everything went ok.
# exit with 1 if something went wrong.
exit $EXITSTATUS
Bisher habe ich den eigentlichen EPG-Scan durch eine modifizierte runvdr ausgelöst, wo alle Transponder angesprungen wurden. So hatte ich zwar bei jedem VDR-Start ein aktuelles EPG, aber alle Transponder für DVB-C und DVB-T anzuspringen, dauert halt auch seine Zeit.
Ich würde also jetzt gerne nur beim 3:00-Uhr Start einen EPG-Scan machen und nach Autotimer-Aktualisierung den VDR herunterfahren.
Habe hier im Forum mal dieses script gefunden, welches ich aber aufgrund mangelnder script-Kenntnisse nicht in meine vdrshutdown intergriert bekomme
ZitatAlles anzeigen# die Uhrzeit fuer den naechsten timer wurde in $1 uebermittelt.
#timer=$1
# wann ist das naechste mal 3 Uhr nachts?
night=`date -d "03:00" +%s`
[ $night -lt `date +%s` ] && night=$(( $night + 24*60*60 ))
# was kommt zuerst: der naechste timer oder 3 uhr nachts?
echo Timer check >> /root/nvram.log
if [ $night -lt $timer ]; then
boottime=$night;
at -f /etc/epgscan.at 3:10;
at -f /etc/shutdown.at 4:00;
fi
In shutdown.at wird
Zitat/usr/bin/svdrsend.pl "hitk power"
und in epgscan.at wird
Zitat/usr/bin/epgscan.sh
aufgerufen.
Wie muss ich dieses script modifizieren, damit es in meine vdrshutdown passt.
Wenn ich diesen code statt dem code vor der zeile
Zitat$NVRAMCMD --configfile=/etc/nvram-wakeup.conf --directisa --settime $boottime
einfüge, klappt es jedenfalls nicht.
Vielen Dank für eure Hilfe.