summaryrefslogtreecommitdiff
path: root/sys-power/apcupsd/files/apcupsd.powerfail.init-r1
blob: d582d9eb5b3a6bac80de0f5c93bc45bc3c6857ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/sbin/openrc-run
# Copyright 2009-2025 Gentoo Authors
# 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 [ -f /etc/apcupsd/powerfail ] ; then
		ebegin 'Signaling UPS to kill power'
		/sbin/apcupsd --killpower
		eend $?
	fi
}