[debian-edu-commits] debian-edu/ 01/01: Remove trailing whitespace from changelog and script. Convert tabs to spaces in shell script.

Petter Reinholdtsen pere at moszumanska.debian.org
Thu Nov 21 09:03:38 UTC 2013


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

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

commit 5dedd3f87c00fea4e8b8f46979849dc894bc4620
Author: Petter Reinholdtsen <pere at hungry.com>
Date:   Thu Nov 21 10:03:35 2013 +0100

    Remove trailing whitespace from changelog and script.  Convert tabs to spaces in shell script.
---
 debian/changelog  |    4 +--
 shutdown-at-night |   70 ++++++++++++++++++++++++++---------------------------
 2 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index dd3dbf9..137a406 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -32,7 +32,7 @@ shutdown-at-night (0.12) unstable; urgency=low
 
   [ Mike Gabriel ]
   * The -i <host-ip> option in the wakeonlan executable is only useful
-    on networks with static ARP tables available. For networks using 
+    on networks with static ARP tables available. For networks using
     dynamic ARP tables (common with most switches), a broadcast address
     instead of a host IP should be given here. The wakeonlan default
     (255.255.255.255) is just fine for most network setups. So we omit
@@ -89,7 +89,7 @@ shutdown-at-night (0.7) unstable; urgency=low
   * Updated Standards-Version from 3.7.3 to 3.8.0.  No changes needed.
 
   [ Holger Levsen ]
-  * Add Vcs: headers to debian/control. 
+  * Add Vcs: headers to debian/control.
 
  -- Petter Reinholdtsen <pere at debian.org>  Wed, 16 Jul 2008 14:34:35 +0200
 
diff --git a/shutdown-at-night b/shutdown-at-night
index d391aae..4427ef7 100755
--- a/shutdown-at-night
+++ b/shutdown-at-night
@@ -22,9 +22,9 @@ unuseddlist="/etc/shutdown-at-night/unused.d /usr/lib/shutdown-at-night/unused.d
 in_netgroup() {
     # Try both long and short name
     for h in "$(uname -n)" "$(hostname -s)" ; do
-	if innetgr -h "$h" "$netgroupname" ; then
-	    return 0
-	fi
+        if innetgr -h "$h" "$netgroupname" ; then
+            return 0
+        fi
     done
     return 1
 }
@@ -77,17 +77,17 @@ nvramwakeup() {
 acpiwakeup() {
     wakeuptime="$1"
     if [ -e /sys/class/rtc/rtc0/wakealarm ] ; then
-	when=$(whentowakeup $wakeuptime)
+        when=$(whentowakeup $wakeuptime)
 
         # First reset alarm
-	echo 0 > /sys/class/rtc/rtc0/wakealarm
+        echo 0 > /sys/class/rtc/rtc0/wakealarm
 
         # Next, set it to our selected time
-	echo $when > /sys/class/rtc/rtc0/wakealarm
-	logger -t shutdown-at-night "scheduled $hostname to turn itself on at $wakeuptime using /sys/class/rtc/rtc0/wakealarm."
-	return 0
+        echo $when > /sys/class/rtc/rtc0/wakealarm
+        logger -t shutdown-at-night "scheduled $hostname to turn itself on at $wakeuptime using /sys/class/rtc/rtc0/wakealarm."
+        return 0
     else
-	return 1
+        return 1
     fi
 }
 
@@ -99,18 +99,18 @@ prepare_wakeonlan() {
 # Return true if local user is logged in, false otherwise
 is_local_user() {
     if [ "$(who)" ] ; then
-	return 0
+        return 0
     else
-	return 1
+        return 1
     fi
 }
 
 # Return true if ldm login is active
 is_active_ldm_session() {
     if ps -efwww | egrep -q ' ssh .*LTSP_CLIEN[T]' ; then
-	return 0
+        return 0
     else
-	return 1
+        return 1
     fi
 }
 
@@ -118,15 +118,15 @@ is_active_ldm_session() {
 # shown).  If not sure, claim it is used to be safe.
 is_xsession_used() {
     for s in \
-	/var/run/gdm3/auth-for-Debian-gdm-*/database \
-	/var/lib/lightdm/.Xauthority \
-	/var/run/xauth/* \
-	/run/xauth/*; do
-	if [ -e "$s" ] ; then
-	    if XAUTHORITY="$s" DISPLAY=:0 xlsclients | egrep -q 'kdmgreet|lightdm-gtk-greeter|razor-lightdm-greeter|lightdm-kde-greeter|gdm-simple-greeter' ; then
-		return 1
-	    fi
-	fi
+        /var/run/gdm3/auth-for-Debian-gdm-*/database \
+        /var/lib/lightdm/.Xauthority \
+        /var/run/xauth/* \
+        /run/xauth/*; do
+        if [ -e "$s" ] ; then
+            if XAUTHORITY="$s" DISPLAY=:0 xlsclients | egrep -q 'kdmgreet|lightdm-gtk-greeter|razor-lightdm-greeter|lightdm-kde-greeter|gdm-simple-greeter' ; then
+                return 1
+            fi
+        fi
     done
     return 0
 }
@@ -134,20 +134,20 @@ is_xsession_used() {
 is_host_unused() {
     # Logged in users, or ldm connection to a remote server
     if is_xsession_used || is_local_user || is_active_ldm_session; then
-	return 1
+        return 1
     fi
     # Uptime is less than one hour
     if (( $(cat /proc/uptime  | awk '{print int($1)}') < 3600 )) ; then
         return 1
     fi
     for dir in $unuseddlist ; do
-	if [ -d $dir ] ; then
+        if [ -d $dir ] ; then
             for f in $dir/* ; do
-		if [ -x $f ] && ! $f ; then
+                if [ -x $f ] && ! $f ; then
                     return 1
-		fi
+                fi
             done
-	fi
+        fi
     done
     return 0
 }
@@ -159,14 +159,14 @@ fatal() {
 
 if enabled_for_host ; then
     if is_host_unused; then
-	logger -t shutdown-at-night "turning off unused client $hostname."
-	if type nvram-wakeup >/dev/null 2>&1 ; then
-	    nvramwakeup $wakeuptime
-	fi
-	acpiwakeup $waketime
-	prepare_wakeonlan || fatal "unable to enable wake-on-lan - aborting shutdown."
-	shutdown -h 5 "Unused host being turned off for the night (cron)." < /dev/null > /dev/null 2>&1 &
-    else 
+        logger -t shutdown-at-night "turning off unused client $hostname."
+        if type nvram-wakeup >/dev/null 2>&1 ; then
+            nvramwakeup $wakeuptime
+        fi
+        acpiwakeup $waketime
+        prepare_wakeonlan || fatal "unable to enable wake-on-lan - aborting shutdown."
+        shutdown -h 5 "Unused host being turned off for the night (cron)." < /dev/null > /dev/null 2>&1 &
+    else
       logger -t shutdown-at-night "client $hostname is in use; shutdown sequence will NOT be initiated."
     fi
 else

-- 
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