diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2009-03-22 15:22:28 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2009-03-22 15:22:28 +0000 |
commit | c694b85204291c363b4a24580c5d9b0b1fff754f (patch) | |
tree | 9f679667b46a9cbca35cbb2b11880f137654f984 /sys-power/apcupsd/files | |
parent | Stable on alpha, bug #258344 (diff) | |
download | historical-c694b85204291c363b4a24580c5d9b0b1fff754f.tar.gz historical-c694b85204291c363b4a24580c5d9b0b1fff754f.tar.bz2 historical-c694b85204291c363b4a24580c5d9b0b1fff754f.zip |
Make the powerfail init script POSIX-compilant, thanks to Davide Pesavento.
Package-Manager: portage-2.2_rc26/cvs/Linux x86_64
Diffstat (limited to 'sys-power/apcupsd/files')
-rw-r--r-- | sys-power/apcupsd/files/apcupsd.powerfail.init | 4 |
1 files changed, 2 insertions, 2 deletions
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 $? |