aports/community/nut/powerfail.initd
Alex Sivchev 20fd39405a community/nut: add script to execute killpower on shutdown
Basically, apcupsd.powerfail.initd from main/apcupsd.
2023-10-08 13:56:02 +00:00

18 lines
384 B
Bash

#!/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 [ "$RC_RUNLEVEL" = "shutdown" -a -f /etc/killpower ] ; then
ebegin 'Signaling UPS to kill power'
/usr/sbin/upsdrvctl shutdown
eend $?
fi
}