aboutsummaryrefslogtreecommitdiffstats
path: root/config/bandwidthd/bandwidthd.inc
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2014-04-22 11:18:00 -0700
committerPhil Davis <phil.davis@inf.org>2014-04-22 11:18:00 -0700
commitdc690b55fe7b55b767af8461c4735ea4a3a60c3b (patch)
tree7d839c9d3278116f8c3db5545ea8c401b4696bd5 /config/bandwidthd/bandwidthd.inc
parentdb5de01c8b3a84203e4256c47ab617d70637060c (diff)
downloadpfsense-packages-dc690b55fe7b55b767af8461c4735ea4a3a60c3b.tar.gz
pfsense-packages-dc690b55fe7b55b767af8461c4735ea4a3a60c3b.tar.bz2
pfsense-packages-dc690b55fe7b55b767af8461c4735ea4a3a60c3b.zip
bandwidthd for 2.2 on nanoBSD
I installed bandwidthd on a 2.2 nanoBSD Alix2D13. The new path to the executable has an extra "/local" in it, and it needs an LD_LIBRARY_PATH to know where to find some of its libraries. With this, it installs, runs and comes up again after a reboot. These changes should all be backward-compatible and make no difference to what happens when installed on older 1.2 2.0 and 2.1 series systems.
Diffstat (limited to 'config/bandwidthd/bandwidthd.inc')
-rw-r--r--config/bandwidthd/bandwidthd.inc11
1 files changed, 9 insertions, 2 deletions
diff --git a/config/bandwidthd/bandwidthd.inc b/config/bandwidthd/bandwidthd.inc
index 7cdc8006..16ce4ab1 100644
--- a/config/bandwidthd/bandwidthd.inc
+++ b/config/bandwidthd/bandwidthd.inc
@@ -34,9 +34,15 @@ switch ($pfs_version) {
case "1.2":
case "2.0":
define('PKG_BANDWIDTHD_BASE', '/usr/local/bandwidthd');
+ define('PKG_BANDWIDTHD_RUNTIME_LIBRARY_ENV', '');
break;
- default:
+ case "2.1":
define('PKG_BANDWIDTHD_BASE', '/usr/pbi/bandwidthd-' . php_uname("m") . '/bandwidthd');
+ define('PKG_BANDWIDTHD_RUNTIME_LIBRARY_ENV', '');
+ break;
+ default:
+ define('PKG_BANDWIDTHD_BASE', '/usr/pbi/bandwidthd-' . php_uname("m") . '/local/bandwidthd');
+ define('PKG_BANDWIDTHD_RUNTIME_LIBRARY_ENV', 'LD_LIBRARY_PATH=/usr/pbi/bandwidthd-' . php_uname("m") . '/local/lib');
}
// End: Check pfSense version
@@ -63,6 +69,7 @@ function bandwidthd_install_config() {
/* the conf file must be ./etc/bandwidthd.conf relative to the current dir */
$bandwidthd_base_dir = PKG_BANDWIDTHD_BASE;
$bandwidthd_config_dir = PKG_BANDWIDTHD_BASE . "/etc";
+ $bandwidthd_runtime_library_env = PKG_BANDWIDTHD_RUNTIME_LIBRARY_ENV;
conf_mount_rw();
config_lock();
@@ -336,7 +343,7 @@ if [ ! -f "{$bandwidthd_htdocs_dir}/logo.gif" ] ; then
/bin/cp {$bandwidthd_base_dir}/htdocs/logo.gif {$bandwidthd_htdocs_dir}
fi
cd {$bandwidthd_nano_dir}
-{$bandwidthd_nano_dir}/bandwidthd
+{$bandwidthd_runtime_library_env} {$bandwidthd_nano_dir}/bandwidthd
cd -
EOD;
} else {