xref: /freebsd/libexec/rc/rc.d/powerd (revision 924226fba12cc9a228c73b956e1b7fa24c60b055)
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