mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-20 09:36:34 +02:00
Executing killpower is needed to ensure that the system will automatically reboot when the mains power is restored [1]. The script was taken from Gentoo [2]. [1] http://www.apcupsd.org/manual/manual.html#shutdown-sequence [2] https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-power/apcupsd/files/apcupsd.powerfail.init
17 lines
389 B
Bash
17 lines
389 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/apcupsd/powerfail ] ; then
|
|
ebegin 'Signaling UPS to kill power'
|
|
/sbin/apcupsd --killpower
|
|
eend $?
|
|
fi
|
|
}
|