Meine Aktuelle Lösung:
Code
hd-vdr:~# cat /usr/local/bin/mypoweroff
#!/bin/bash -x
now=`date -u +%s`
nextboot=`echo "$now + 3 * 60" | bc`
if [ x$1 = x ]
then
nextboot=` svdrpsend.pl next abs|grep 250|cut -c 7-16`
else
nextboot=$1
fi
/etc/init.d/vdr-frontend stop
/etc/init.d/vdr stop
sleep 10
cd /usr/src/ngene-test/v4l
./scripts/rmmod.pl unload
DEV=/sys/class/rtc/rtc0/wakealarm
#sync the rtc watch
hwclock --utc --systohc
tomorrowtreeohclock=`date --date="tomorrow 03:00" +"%s"`
nextboot=`echo "$nextboot-300"|bc`
if [ "$nextboot" -ge "$tomorrowtreeohclock" ]
then
echo "3 Uhr ist früher. Setzte Wakeup auf $tomorrowtreeohclock"
nextboot=$tomorrowtreeohclock
fi
echo 0 > $DEV
echo $nextboot > $DEV
echo "mem" > /sys/power/state
echo "Wakeup"
sleep 10
reboot
Alles anzeigen
Reboot weil der Wakeup beim zweiten mal nicht ordentlich funktioniert.