openrc/init.d/powerd.in
William Hubbs 3470eda3f5 Rename runscript to openrc-run
This was requested by Debian, because the minicom software, which is
available on Debian and other distros, has a binary named runscript. We
are keeping a backward compatibility symlink for now, but this allows
Debian or any other distro to safely remove the symlink.

X-Gentoo-Bug: 494220
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=494220
2013-12-29 22:57:31 -06:00

36 lines
683 B
Plaintext

#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.
command=/usr/sbin/powerd
command_args=$powerd_args
pidfile=/var/run/powerd.pid
name="Power Control Daemon"
depend()
{
need localmount
use logger
after bootmisc
keyword -jail -prefix
}
start_pre()
{
if [ -n "$powerd_battery_mode" ]; then
command_args="$command_args -b $powerd_battery_mode"
fi
if [ -n "${powerd_ac_mode}" ]; then
command_args="$command_args -a $powerd_ac_mode"
fi
}
stop_post()
{
local level=$(sysctl -n dev.cpu.0.freq_levels |
sed -e 's:/.*::')
if [ -n "$level" ]; then
sysctl dev.cpu.0.freq="$level" >/dev/null
fi
}