summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2009-03-22 15:22:28 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2009-03-22 15:22:28 +0000
commited99e570b984ac703f106153c139a14a6bbfd793 (patch)
tree8f0a5369fe828a20f7afb81c2cd6ba06367fda46 /sys-power
parentStable on alpha, bug #258344 (diff)
downloadgentoo-2-ed99e570b984ac703f106153c139a14a6bbfd793.tar.gz
gentoo-2-ed99e570b984ac703f106153c139a14a6bbfd793.tar.bz2
gentoo-2-ed99e570b984ac703f106153c139a14a6bbfd793.zip
Make the powerfail init script POSIX-compilant, thanks to Davide Pesavento.
(Portage version: 2.2_rc26/cvs/Linux x86_64)
Diffstat (limited to 'sys-power')
-rw-r--r--sys-power/apcupsd/ChangeLog7
-rw-r--r--sys-power/apcupsd/files/apcupsd.powerfail.init4
2 files changed, 8 insertions, 3 deletions
diff --git a/sys-power/apcupsd/ChangeLog b/sys-power/apcupsd/ChangeLog
index 574af6ad09cf..a2456e081ebe 100644
--- a/sys-power/apcupsd/ChangeLog
+++ b/sys-power/apcupsd/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for sys-power/apcupsd
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/ChangeLog,v 1.43 2009/03/22 13:58:12 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/ChangeLog,v 1.44 2009/03/22 15:22:28 flameeyes Exp $
+
+ 22 Mar 2009; Diego E. Pettenò <flameeyes@gentoo.org>
+ files/apcupsd.powerfail.init:
+ Make the powerfail init script POSIX-compilant, thanks to Davide
+ Pesavento.
*apcupsd-3.14.5-r2 (22 Mar 2009)
diff --git a/sys-power/apcupsd/files/apcupsd.powerfail.init b/sys-power/apcupsd/files/apcupsd.powerfail.init
index 35ee364c80ca..49c5db45c800 100644
--- a/sys-power/apcupsd/files/apcupsd.powerfail.init
+++ b/sys-power/apcupsd/files/apcupsd.powerfail.init
@@ -1,7 +1,7 @@
#!/sbin/runscript
# Copyright 2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/files/apcupsd.powerfail.init,v 1.1 2009/03/22 13:58:11 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/files/apcupsd.powerfail.init,v 1.2 2009/03/22 15:22:28 flameeyes Exp $
description='Signal the UPS to kill power in a power failure condition'
@@ -10,7 +10,7 @@ depend() {
}
start() {
- if [[ $(runlevel) == *' 0' && -f /etc/apcupsd/powerfail ]] ; then
+ if [ "$(runlevel | cut -d' ' -f2)" = "0" -a -f /etc/apcupsd/powerfail ] ; then
ebegin 'Signaling UPS to kill power'
/sbin/apcupsd --killpower
eend $?