~ubuntu-branches/ubuntu/saucy/nut/saucy

« back to all changes in this revision

Viewing changes to scripts/RedHat/halt.patch

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Quette
  • Date: 2004-05-28 13:10:01 UTC
  • mto: (16.1.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20040528131001-yj2m9qcez4ya2w14
Tags: upstream-1.4.2
ImportĀ upstreamĀ versionĀ 1.4.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--- /etc/rc.d/init.d/halt       Thu Mar 28 00:21:19 2002
 
2
+++ halt.new    Fri Jan 31 15:29:49 2003
 
3
@@ -8,8 +8,17 @@
 
4
 #               Modified for RHS Linux by Damien Neil
 
5
 #
 
6
 
 
7
+# 2003-01-31 Antonino Albanese <al.an@monkeysweb.net>
 
8
+# Modified ups shutdown for new NUT method
 
9
+#
 
10
 # Set the path.
 
11
 PATH=/sbin:/bin:/usr/bin:/usr/sbin
 
12
+# load /etc/sysconfig/ups if present I've put the POWERDOWNFLAG
 
13
+# in there so noboby have to manually modify the shutdown script
 
14
+if [ -f /etc/sysconfig/ups ]; then
 
15
+   . /etc/sysconfig/ups
 
16
+fi
 
17
+UPSCMD=`which upsdrvctl`
 
18
 
 
19
 export NOLOCALE=1
 
20
 . /etc/init.d/functions
 
21
@@ -198,10 +208,15 @@
 
22
 fi
 
23
 
 
24
 if [ "$command" = halt ] ; then
 
25
-    if [ -r /etc/ups/upsmon.conf -a -f /etc/killpower -a -f /etc/sysconfig/ups ] ; then
 
26
-        . /etc/sysconfig/ups
 
27
-        [ "$SERVER" = "yes" -a "$MODEL" != "NONE" -a -n "$MODEL" -a -n "$DEVICE" ] && $MODEL -k $DEVICE
 
28
-    fi
 
29
+#    if [ -r /etc/ups/upsmon.conf -a -f /etc/killpower -a -f /etc/sysconfig/ups ] ; then
 
30
+#        . /etc/sysconfig/ups
 
31
+#        [ "$SERVER" = "yes" -a "$MODEL" != "NONE" -a -n "$MODEL" -a -n "$DEVICE" ] && $MODEL -k $DEVICE
 
32
+#    fi
 
33
+   if [ -n "$POWERDOWNFLAG" -a -n "$UPSCMD" ]; then
 
34
+      if [ -f $POWERDOWNFLAG ]; then
 
35
+         $UPSCMD shutdown
 
36
+      fi
 
37
+   fi
 
38
 fi
 
39
 
 
40
 if [ -x "/sbin/halt.local" ]; then