diff options
author | Jim P <jim@pingle.org> | 2012-04-13 13:27:16 -0700 |
---|---|---|
committer | Jim P <jim@pingle.org> | 2012-04-13 13:27:16 -0700 |
commit | 9583759704e4af48e52ed4309780fdf759f4872d (patch) | |
tree | 0b69392761bb9413bd98d487edc8461fadcad7cc /etc/inc/system.inc | |
parent | d46c3acd20608169bc577c81806064499db3f946 (diff) | |
parent | 53c210dd6451f1bb82347e37c89652f7818122aa (diff) | |
download | pfsense-9583759704e4af48e52ed4309780fdf759f4872d.zip pfsense-9583759704e4af48e52ed4309780fdf759f4872d.tar.gz |
Merge pull request #90 from vizvayu/master
Mode selection options for PowerD
Diffstat (limited to 'etc/inc/system.inc')
-rw-r--r-- | etc/inc/system.inc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc index d6a43fd..d4cf6ed 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -42,13 +42,15 @@ function activate_powerd() { global $config, $g; if ($g['platform'] == 'jail') return; + if(is_process_running("powerd")) + exec("/usr/bin/killall powerd"); if(isset($config['system']['powerd_enable'])) { if ($g["platform"] == "nanobsd") exec("/sbin/kldload cpufreq"); - exec("/usr/sbin/powerd -b adp -a adp"); - } else { - if(is_process_running("powerd")) - exec("/usr/bin/killall powerd"); + $mode = "hadp"; + if (!empty($config['system']['powerd_mode'])) + $mode = $config['system']['powerd_mode']; + mwexec("/usr/sbin/powerd -b $mode -a $mode"); } } |