summaryrefslogtreecommitdiff
blob: be591f86c1850297765b1cc1a3aee61fb265c38f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/sbin/openrc-run
# Copyright 2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

description='Signal the UPS to kill power in a power failure condition'

depend() {
	need mount-ro
}

start() {
	if [ "$(runlevel | cut -d' ' -f2)" = "0" -a -f /etc/apcupsd/powerfail ] ; then
		ebegin 'Signaling UPS to kill power'
		/sbin/apcupsd --killpower
		eend $?
	fi
}