aboutsummaryrefslogtreecommitdiff
path: root/init.d.BSD/powerd
diff options
context:
space:
mode:
Diffstat (limited to 'init.d.BSD/powerd')
-rw-r--r--init.d.BSD/powerd19
1 files changed, 14 insertions, 5 deletions
diff --git a/init.d.BSD/powerd b/init.d.BSD/powerd
index a97e2e02..c7886942 100644
--- a/init.d.BSD/powerd
+++ b/init.d.BSD/powerd
@@ -25,7 +25,7 @@
# SUCH DAMAGE.
command=/usr/sbin/powerd
-command_args=${POWERD_ARGS}
+command_args=${powerd_args}
pidfile=/var/run/powerd.pid
name="Power Control Daemon"
@@ -36,10 +36,19 @@ depend() {
}
start_pre() {
- if [ -n "${BATTERY_MODE}" ]; then
- command_args="${command_args} -b ${BATTERY_MODE}"
+ if [ -n "${powerd_battery_mode}" ]; then
+ command_args="${command_args} -b ${powerd_battery_mode}"
fi
- if [ -n "${AC_MODE}" ]; then
- command_args="${command_args} -a ${AC_MODE}"
+ 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
}