From: | "Diego Petteno (flameeyes)" <flameeyes@g.o> |
---|---|
To: | gentoo-commits@l.g.o |
Subject: | [gentoo-commits] gentoo-x86 commit in sys-power/apcupsd/files: apcupsd.powerfail.init |
Date: | Sun, 22 Mar 2009 15:22:36 |
Message-Id: | E1LlPVM-0001v9-42@stork.gentoo.org |
1 | flameeyes 09/03/22 15:22:28 |
2 | |
3 | Modified: apcupsd.powerfail.init |
4 | Log: |
5 | Make the powerfail init script POSIX-compilant, thanks to Davide Pesavento. |
6 | (Portage version: 2.2_rc26/cvs/Linux x86_64) |
7 | |
8 | Revision Changes Path |
9 | 1.2 sys-power/apcupsd/files/apcupsd.powerfail.init |
10 | |
11 | file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-power/apcupsd/files/apcupsd.powerfail.init?rev=1.2&view=markup |
12 | plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-power/apcupsd/files/apcupsd.powerfail.init?rev=1.2&content-type=text/plain |
13 | diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-power/apcupsd/files/apcupsd.powerfail.init?r1=1.1&r2=1.2 |
14 | |
15 | Index: apcupsd.powerfail.init |
16 | =================================================================== |
17 | RCS file: /var/cvsroot/gentoo-x86/sys-power/apcupsd/files/apcupsd.powerfail.init,v |
18 | retrieving revision 1.1 |
19 | retrieving revision 1.2 |
20 | diff -u -r1.1 -r1.2 |
21 | --- apcupsd.powerfail.init 22 Mar 2009 13:58:11 -0000 1.1 |
22 | +++ apcupsd.powerfail.init 22 Mar 2009 15:22:28 -0000 1.2 |
23 | @@ -1,7 +1,7 @@ |
24 | #!/sbin/runscript |
25 | # Copyright 2009 Gentoo Foundation |
26 | # Distributed under the terms of the GNU General Public License v2 |
27 | -# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/files/apcupsd.powerfail.init,v 1.1 2009/03/22 13:58:11 flameeyes Exp $ |
28 | +# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/files/apcupsd.powerfail.init,v 1.2 2009/03/22 15:22:28 flameeyes Exp $ |
29 | |
30 | description='Signal the UPS to kill power in a power failure condition' |
31 | |
32 | @@ -10,7 +10,7 @@ |
33 | } |
34 | |
35 | start() { |
36 | - if [[ $(runlevel) == *' 0' && -f /etc/apcupsd/powerfail ]] ; then |
37 | + if [ "$(runlevel | cut -d' ' -f2)" = "0" -a -f /etc/apcupsd/powerfail ] ; then |
38 | ebegin 'Signaling UPS to kill power' |
39 | /sbin/apcupsd --killpower |
40 | eend $? |