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 13:58:14 |
Message-Id: | E1LlOBn-00087F-O0@stork.gentoo.org |
1 | flameeyes 09/03/22 13:58:11 |
2 | |
3 | Added: apcupsd.powerfail.init |
4 | Log: |
5 | Add init script for shutting the UPS down on power failure. Thanks to Matt Whitlock in bug #262234. |
6 | (Portage version: 2.2_rc26/cvs/Linux x86_64) |
7 | |
8 | Revision Changes Path |
9 | 1.1 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.1&view=markup |
12 | plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-power/apcupsd/files/apcupsd.powerfail.init?rev=1.1&content-type=text/plain |
13 | |
14 | Index: apcupsd.powerfail.init |
15 | =================================================================== |
16 | #!/sbin/runscript |
17 | # Copyright 2009 Gentoo Foundation |
18 | # Distributed under the terms of the GNU General Public License v2 |
19 | # $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/files/apcupsd.powerfail.init,v 1.1 2009/03/22 13:58:11 flameeyes Exp $ |
20 | |
21 | description='Signal the UPS to kill power in a power failure condition' |
22 | |
23 | depend() { |
24 | need mount-ro |
25 | } |
26 | |
27 | start() { |
28 | if [[ $(runlevel) == *' 0' && -f /etc/apcupsd/powerfail ]] ; then |
29 | ebegin 'Signaling UPS to kill power' |
30 | /sbin/apcupsd --killpower |
31 | eend $? |
32 | fi |
33 | } |