BUG in S90.nvram-wakeup script

Wolfram Webers pkg-vdr-dvb-devel@lists.alioth.debian.org
Tue, 18 Jan 2005 20:08:57 -0000


Hi,

I found a serious bug in your S90.nvram-wakeup script. It simply fails to
set the correct next nvram-event, when shutting down the computer via VDR
after midnight.

The reason is simple. The script compare only the next pending VDR recording
event with its next nvram-event by adding constantly one day to this event.
The lesser of both of them wins the race.

But, if your shutdown after midnight, having already planed to wakeup at 8am
in the morning, this event is contantly ignored.

My working solution extends the S90.nvram-wakeup script as follows:

# when no vdr timer is set or vdr timer starts later than regular timer:
if [ $TIMER -eq 0 ] || [ $TIMER -gt 0 -a $REGULAR_TIMER -lt $TIMER ] ; then
TIMER=$REGULAR_TIMER
fi

# now check a valid nvram event for today, and take this one instead
NOW=`date +%s`
TODAY_TIMER=`date -d "$REGULAR_TIME" +%s`

if [ $TODAY_TIMER -gt $NOW ] && [ $TODAY_TIMER -lt $TIMER ] ; then
TIMER=$TODAY_TIMER
fi

It would be nice, if you could take this patch into your distribution (and
also into the ones of the C't magazin)

Greetings,

Wolfram Webers


__________________________________________________________
Diese Nachricht wurde durch prosite.de WebMailer 1.8 gesendet.