xref: /freebsd/libexec/rc/rc.d/powerd (revision 6829dae12bb055451fa467da4589c43bd03b1e64)
1#!/bin/sh
2#
3# $FreeBSD$
4#
5
6# PROVIDE: powerd
7# REQUIRE: DAEMON
8# BEFORE: LOGIN
9# KEYWORD: nojail shutdown
10
11. /etc/rc.subr
12
13name="powerd"
14desc="Modify the power profile based on AC line state"
15rcvar="powerd_enable"
16command="/usr/sbin/${name}"
17stop_postcmd=powerd_poststop
18
19powerd_poststop()
20{
21	sysctl dev.cpu.0.freq=`sysctl -n dev.cpu.0.freq_levels |
22	    sed -e 's:/.*::'` > /dev/null
23}
24
25load_rc_config $name
26run_rc_command "$1"
27