freebsd-skq/etc/rc.d/powerd
Colin Percival 1dcb6ad173 When stopping powerd, set the CPU frequency back to its maximum value
(i.e., what it was almost certainly at before powerd was started).

Submitted by:	R.B. Riddick
MFC after:	3 days
2006-08-27 11:04:39 +00:00

26 lines
361 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: powerd
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: nojail
. /etc/rc.subr
name="powerd"
rcvar=`set_rcvar`
command="/usr/sbin/${name}"
stop_postcmd=powerd_poststop
powerd_poststop()
{
sysctl dev.cpu.0.freq=`sysctl -n dev.cpu.0.freq_levels |
sed -e 's:/.*::'` > /dev/null
}
load_rc_config $name
run_rc_command "$1"