[debian-edu-commits] debian-edu/shutdown-at-night.git (#15) - master (branch) updated: 9922b4cda01b2fce9745c569833bec593a15544e
Mike Gabriel
sunweaver at alioth.debian.org
Wed Oct 23 09:52:05 UTC 2013
The branch, master has been updated
via 9922b4cda01b2fce9745c569833bec593a15544e (commit)
from dc93f1984f81599e86fc7bfec979ba4629cfdadd (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 9922b4cda01b2fce9745c569833bec593a15544e
Author: Petter Reinholdtsen <pere at hungry.com>
Date: Fri Jun 13 07:34:26 2008 +0000
* Convert wakeupclients to use syslog.
git-svn-id: svn+ssh://svn.debian.org/svn/debian-edu/trunk/src/shutdown-at-night@41448 6e500793-9bee-0310-a5b0-9d0909bd054d
-----------------------------------------------------------------------
Summary of changes:
debian/changelog | 6 ++++++
wakeupclients | 12 ++++++++----
2 files changed, 14 insertions(+), 4 deletions(-)
The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index e6f8a7e..db2649a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+shutdown-at-night (0.3) UNRELEASED; urgency=low
+
+ * Convert wakeupclients to use syslog.
+
+ -- Petter Reinholdtsen <pere at debian.org> Fri, 13 Jun 2008 09:33:08 +0200
+
shutdown-at-night (0.2) unstable; urgency=low
* Add server side cron job to start waking up clients Monday-Friday at 06:30.
diff --git a/wakeupclients b/wakeupclients
index b0b8a5d..4ffaa15 100755
--- a/wakeupclients
+++ b/wakeupclients
@@ -3,6 +3,8 @@
use strict;
use warnings;
+use Sys::Syslog qw(openlog syslog closelog LOG_NOTICE);
+
my $delay = 5;
my $wakeuplist = "/etc/shutdown-at-night/clients";
@@ -27,11 +29,11 @@ map { $alive{$_} = 1; } get_alive_list(keys %hwaddrs);
# Start sending wakeup calls
for my $ip (sort keys %hwaddrs) {
if (! defined $alive{$ip}) {
- syslog("sending wake-on-lan package to $ip [$hwaddrs{$ip}]");
+ logmsg("sending wake-on-lan to $ip [$hwaddrs{$ip}]");
wakeup($ip, $hwaddrs{$ip});
sleep $delay;
} else {
- syslog("not sending wake-on-lan package to already awake $ip [$hwaddrs{$ip}]");
+ logmsg("not sending wake-on-lan to already awake $ip [$hwaddrs{$ip}]");
}
}
@@ -48,7 +50,9 @@ sub get_alive_list {
return split(/\s+/, `fping -a @addresses`);
}
-sub syslog {
+sub logmsg {
my $msg = shift;
- print "$msg\n";
+ openlog("wakeupclients", undef, 'user');
+ syslog(LOG_NOTICE, "%s", $msg);
+ closelog;
}
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