[debian-edu-commits] debian-edu/ 46/64: Do not shut down if uptime is less then an hour. Based on patch and idea from Jonathan Jackson in BTS report #619950.

Mike Gabriel sunweaver at debian.org
Wed Oct 23 09:51:55 UTC 2013


This is an automated email from the git hooks/post-receive script.

sunweaver pushed a commit to branch master
in repository shutdown-at-night.

commit c139ca0dd762437ce8058cbf06510edb97506c18
Author: Petter Reinholdtsen <pere at hungry.com>
Date:   Wed Jan 4 18:15:32 2012 +0000

    Do not shut down if uptime is less then an hour.  Based on patch and
    idea from Jonathan Jackson in BTS report #619950.
    
    git-svn-id: svn+ssh://svn.debian.org/svn/debian-edu/trunk/src/shutdown-at-night@74928 6e500793-9bee-0310-a5b0-9d0909bd054d
---
 debian/changelog  |    7 +++++++
 shutdown-at-night |    4 ++++
 2 files changed, 11 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index f790f91..e3fe494 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+shutdown-at-night (0.10) UNRELEASED; urgency=low
+
+  * Do not shut down if uptime is less then an hour.  Based on patch and
+    idea from Jonathan Jackson in BTS report #619950.
+
+ -- Petter Reinholdtsen <pere at debian.org>  Wed, 04 Jan 2012 19:15:04 +0100
+
 shutdown-at-night (0.9) unstable; urgency=low
 
   * Sync with Ubuntu version 0.8ubuntu1:
diff --git a/shutdown-at-night b/shutdown-at-night
index 598bf06..7e150d5 100755
--- a/shutdown-at-night
+++ b/shutdown-at-night
@@ -66,6 +66,10 @@ is_host_unused() {
     if [ "$(who)" ] ||  ps -efwww | egrep -q ' ssh .*LTSP_CLIEN[T]' ; then
 	return 1
     fi
+    # Uptime is less than one hour
+    if (( $(cat /proc/uptime  | awk '{print int($1)}') < 3600 )) ; then
+        return 1
+    fi
     return 0
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/pkg-team/shutdown-at-night.git



More information about the debian-edu-commits mailing list