aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorJim P <jim@pingle.org>2012-07-15 07:49:25 -0700
committerJim P <jim@pingle.org>2012-07-15 07:49:25 -0700
commit52c20186cfcd60812ea84dd00a54c2580ad01531 (patch)
tree748cd0b8556123325049ab1a95c76b755b98ba05 /config
parentecbb8b086cc2defd17d1ecbae844b9d293e16e28 (diff)
parent337ff37bacb9cd5797b110845e31b8f54bf92888 (diff)
downloadpfsense-packages-52c20186cfcd60812ea84dd00a54c2580ad01531.tar.gz
pfsense-packages-52c20186cfcd60812ea84dd00a54c2580ad01531.tar.bz2
pfsense-packages-52c20186cfcd60812ea84dd00a54c2580ad01531.zip
Merge pull request #285 from phil-davis/master
Standard pfSense version check, fix promiscuous mode setting
Diffstat (limited to 'config')
-rw-r--r--config/bandwidthd/bandwidthd.inc23
1 files changed, 16 insertions, 7 deletions
diff --git a/config/bandwidthd/bandwidthd.inc b/config/bandwidthd/bandwidthd.inc
index da7260bc..bf0f5794 100644
--- a/config/bandwidthd/bandwidthd.inc
+++ b/config/bandwidthd/bandwidthd.inc
@@ -28,11 +28,17 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-if (substr(trim(file_get_contents("/etc/version")),0,3) == "2.1") {
- define('PKG_BANDWIDTHD_BASE', '/usr/pbi/bandwidthd-' . php_uname("m") . '/bandwidthd');
-} else {
- define('PKG_BANDWIDTHD_BASE', '/usr/local/bandwidthd');
-}
+// Check pfSense version
+$pfs_version = substr(trim(file_get_contents("/etc/version")),0,3);
+switch ($pfs_version) {
+ case "1.2":
+ case "2.0":
+ define('PKG_BANDWIDTHD_BASE', '/usr/local/bandwidthd');
+ break;
+ default:
+ define('PKG_BANDWIDTHD_BASE', '/usr/pbi/bandwidthd-' . php_uname("m") . '/bandwidthd');
+ }
+// End: Check pfSense version
function bandwidthd_install_deinstall() {
conf_mount_rw();
@@ -72,6 +78,9 @@ function bandwidthd_install_config() {
$promiscuous = $config['installedpackages']['bandwidthd']['config'][0]['promiscuous'];
if($promiscuous)
$promiscuous = "promiscuous true\n";
+ else
+ $promiscuous = "promiscuous false\n";
+
$graph_cutoff = $config['installedpackages']['bandwidthd']['config'][0]['graphcutoff'];
if($graph_cutoff)
$graph_cutoff = "graph_cutoff $graph_cutoff\n";
@@ -82,7 +91,7 @@ function bandwidthd_install_config() {
if($config['installedpackages']['bandwidthd']['config'][0]['active_interface']){
$ifdescrs = array($config['installedpackages']['bandwidthd']['config'][0]['active_interface']);
} else {
- log_error("You should specify a interface for bandwidthd to listen on. exiting.");
+ log_error("You should specify an interface for bandwidthd to listen on. Exiting.");
}
$subnets_custom = split(';',str_replace(' ','',$config['installedpackages']['bandwidthd']['config'][0]['subnets_custom']));
@@ -215,4 +224,4 @@ EOF;
}
-?>
+?> \ No newline at end of file