[debian-edu-commits] debian-edu/shutdown-at-night.git (#54) - master (branch) updated: f822644162513122c806e8de393458115cffdd49
Mike Gabriel
sunweaver at alioth.debian.org
Wed Oct 23 09:24:21 UTC 2013
The branch, master has been updated
via f822644162513122c806e8de393458115cffdd49 (commit)
from b9017d8990c2dc97eeb09ac6cdab215778b7d4ca (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit f822644162513122c806e8de393458115cffdd49
Author: Petter Reinholdtsen <pere at hungry.com>
Date: Sun Jul 21 10:43:28 2013 +0000
Correct time zone calculations, try to ensure that the 07:00 wake
up time is in the local time zone and not UTC.
git-svn-id: svn+ssh://svn.debian.org/svn/debian-edu/trunk/src/shutdown-at-night@81779 6e500793-9bee-0310-a5b0-9d0909bd054d
-----------------------------------------------------------------------
Summary of changes:
debian/changelog | 2 ++
shutdown-at-night | 7 ++++++-
2 files changed, 8 insertions(+), 1 deletion(-)
The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 855fffc..d1ad3c0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ shutdown-at-night (0.12) UNRELEASED; urgency=low
* Add support for using the ACPI RTC wakeup interface to wake up the
machine (Closes: #717441).
+ * Correct time zone calculations, try to ensure that the 07:00 wake
+ up time is in the local time zone and not UTC.
-- Petter Reinholdtsen <pere at debian.org> Mon, 15 Jul 2013 17:26:08 +0200
diff --git a/shutdown-at-night b/shutdown-at-night
index 5d83a27..9734995 100755
--- a/shutdown-at-night
+++ b/shutdown-at-night
@@ -37,11 +37,16 @@ enabled_for_host() {
return 1
}
+# Take wakeup hour:minute in local time zone and return wake up time
+# in seconds since EPOC UTC, radomized around the target wakeup time.
whentowakeup() {
wakeuptime=$1
# Spread the BIOS wakeup time across a 20 minute period, to avoid
# all of them waking up at the same time, killing a fuse.
- echo $(( $(date -u +%s -d "tomorrow $wakeuptime") - 600 + $RANDOM % 1200))
+
+ # Convert local target time in seconds since EPOC UTC
+ targettime=$(date +%s -d "tomorrow $wakeuptime $(date +%z)")
+ echo $(( $targettime - 600 + $RANDOM % 1200))
}
nvramwakeup() {
hooks/post-receive
--
shutdown-at-night.git (shutdown-at-night Debian package)
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "shutdown-at-night.git" (shutdown-at-night Debian package).
More information about the debian-edu-commits
mailing list