#!/bin/sh # PROVIDE: cpupowerd # REQUIRE: DAEMON # BEFORE: LOGIN # KEYWORD: nojail # # Add the following line to /etc/rc.conf[.local] to enable cpupowerd # # cpupowerd_enable (bool): Set to "NO" by default. # Set it to "YES" to enable cpupowerd. # cpupowerd_config (str): Custom config file for cpupowerd. # (default /usr/local/etc/cpupowerd.conf) # cpupowerd_flags (str): Custom additional arguments to be passed # to cpupowerd (default -d -c cpupowerd.conf). # . /etc/rc.subr name="cpupowerd" rcvar=`set_rcvar` command=%%PREFIX%%/sbin/${name} start_precmd="${name}_precmd" load_rc_config $name # set default : ${cpupowerd_enable="NO"} : ${cpupowerd_config="%%PREFIX%%/etc/cpupowerd.conf"} command_args="-d -c ${cpupowerd_config} ${cpupowerd_flags}" cpupowerd_precmd() { if [ ! -c "/dev/%%CPUCTL%%0" ]; then kldload %%CPUCTL%% fi } run_rc_command "$1"