Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37552831
en ru br
ALT Linux repos
S:2.2.0-alt12
D:1.6.0-alt1
3.0: 1.3.15-alt1

Group :: Video
RPM: vdr

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

#!/bin/bash

# Modify /sbin/halt.local to call this script. For more information,
# see /usr/share/doc/vdr*/README.package
#
# If /sbin/halt.local does not exist, something like the following shell
# script should work. Remember to make it executable.
#
# #!/bin/sh
# /usr/lib/vdr/bin/vdr-halt.local.sh

wakeupfile=/var/lib/vdr/next-wakeup
rtcdir=/sys/class/rtc/rtc0
procalarm=/proc/acpi/alarm

trap "rm -f $wakeupfile" EXIT

if [ -s $wakeupfile ] ; then
secs=$(cat $wakeupfile)
datestr="1970-01-01 UTC $secs sec"
echo -n "Setting wakeup for next VDR timer: " ; date -d "$datestr"
if [ -w $rtcdir/wakealarm ] ; then
offset=0
[ -r $rtcdir/since_epoch ] && \
offset=$(( $(cat $rtcdir/since_epoch) - $(date +%s) ))
echo 0 > $rtcdir/wakealarm
echo $(( $secs + $offset )) > $rtcdir/wakealarm
elif [ -w $procalarm ] ; then
grep -qsx UTC /etc/adjtime && utc=--utc || utc=
date $utc -d "$datestr" +"%F %T" > $procalarm
else
echo "Warning: no supported methods found, wakeup not set."
sleep 1
fi
fi
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin