[debian-edu-commits] debian-edu/shutdown-at-night.git (#6) - master (branch) updated: 597ebc8f87cc6722ebcbc6bc0043e79f92bb9ea5
Mike Gabriel
sunweaver at alioth.debian.org
Wed Oct 23 09:52:02 UTC 2013
The branch, master has been updated
via 597ebc8f87cc6722ebcbc6bc0043e79f92bb9ea5 (commit)
from 775e09aa9f0089bd8ad8901056d4c5956a0695a8 (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 597ebc8f87cc6722ebcbc6bc0043e79f92bb9ea5
Author: Petter Reinholdtsen <pere at hungry.com>
Date: Sun Jun 8 16:14:08 2008 +0000
Allow clients to be enabled using the netgroup host-shutdown-at-night.
git-svn-id: svn+ssh://svn.debian.org/svn/debian-edu/trunk/src/shutdown-at-night@41395 6e500793-9bee-0310-a5b0-9d0909bd054d
-----------------------------------------------------------------------
Summary of changes:
README | 3 ++-
debian/control | 2 +-
shutdown-at-night | 13 +++++++------
3 files changed, 10 insertions(+), 8 deletions(-)
The diff of changes is:
diff --git a/README b/README
index f9a0fcf..46b282b 100644
--- a/README
+++ b/README
@@ -9,7 +9,8 @@ them automatically on in the morning.
- use wake on lan or nvram-wakeup
To enable automatic shutdown, touch
-/etc/shutdown-at-night/shutdown-at-night
+/etc/shutdown-at-night/shutdown-at-night, or add the hostname to the
+netgroup "host-shutdown-at-night".
To enable wakeonlan, add the clients to
/etc/shutdown-at-night/clients, with one line per client, IP address
diff --git a/debian/control b/debian/control
index 2ce028c..5258be5 100644
--- a/debian/control
+++ b/debian/control
@@ -7,7 +7,7 @@ Build-Depends: debhelper (>= 5), cdbs
Package: shutdown-at-night
Architecture: all
-Depends: ${misc:Depends}, wakeonlan
+Depends: ${misc:Depends}, wakeonlan, ng-utils
Recommends: nvram-wakeup
Description: System to shut down clients at night, and wake them in the morning
Schedule shutdown in the evening, and uses nvram-wakeup or wakeonlan to wake
diff --git a/shutdown-at-night b/shutdown-at-night
index 2dced23..2d1f213 100755
--- a/shutdown-at-night
+++ b/shutdown-at-night
@@ -8,20 +8,21 @@
wakeuptime="07:00"
-hostname=$(uname -n)
+hostname="$(uname -n)"
+netgroupname="host-shutdown-at-night"
+
+in_netgroup() {
+ innetgr -h "$hostname" "$netgroupname"
+}
enabled_for_host() {
# Flag for now
- if [ -f /etc/shutdown-at-night/shutdown-at-night ] ; then
+ if [ -f /etc/shutdown-at-night/shutdown-at-night ] || in_netgroup; then
true
fi
false;
}
-netgroup_lookup() {
- innetgr -h $hostname host-shutdown-at-night
-}
-
nvramwakeup() {
# http://www.vdr-portal.de/board/thread.php?threadid=75582&sid=b7aced20e710aef12ffa56b5197fe168
wakeuptime=$1
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