aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2012-06-15 12:22:19 -0400
committerjim-p <jimp@pfsense.org>2012-06-15 12:22:19 -0400
commit9899498204330aeadc5e84f16018901b7e9e9220 (patch)
tree6e22244308361fca67afbafd7692d3ff1535c335
parent359a96da4f2fdb03bef8eda43ccd77400fcb162b (diff)
downloadpfsense-packages-9899498204330aeadc5e84f16018901b7e9e9220.tar.gz
pfsense-packages-9899498204330aeadc5e84f16018901b7e9e9220.tar.bz2
pfsense-packages-9899498204330aeadc5e84f16018901b7e9e9220.zip
Fixup quagga and openbgpd config at bootup issue (use constant, php isn't respecting the global in the context it's called in at boot time)
-rw-r--r--config/openbgpd/openbgpd.inc10
-rw-r--r--config/quagga_ospfd/quagga_ospfd.inc9
2 files changed, 12 insertions, 7 deletions
diff --git a/config/openbgpd/openbgpd.inc b/config/openbgpd/openbgpd.inc
index b06a0fa8..b8cfbe2a 100644
--- a/config/openbgpd/openbgpd.inc
+++ b/config/openbgpd/openbgpd.inc
@@ -29,7 +29,8 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-$bgpd_config_base = "/var/etc/openbgpd";
+define('PKG_BGPD_CONFIG_BASE', '/var/etc/openbgpd');
+
$pkg_login = "_bgpd";
$pkg_uid = "130";
$pkg_group = "_bgpd";
@@ -40,10 +41,12 @@ $pkg_shell = "/usr/sbin/nologin";
function openbgpd_install_conf() {
- global $config, $g, $bgpd_config_base, $pkg_login, $pkg_uid, $pkg_group, $pkg_gid, $pkg_gecos, $pkg_homedir, $pkg_shell;
+ global $config, $g, $pkg_login, $pkg_uid, $pkg_group, $pkg_gid, $pkg_gecos, $pkg_homedir, $pkg_shell;
conf_mount_rw();
+ // Since we need to embed this in a string, copy to a var. Can't embed constnats.
+ $bgpd_config_base = PKG_BGPD_CONFIG_BASE;
if ($config['installedpackages']['openbgpd']['rawconfig'] && $config['installedpackages']['openbgpd']['rawconfig']['item']) {
// if there is a raw config specified in the config.xml use that instead of the assisted config
$conffile = implode("\n",$config['installedpackages']['openbgpd']['rawconfig']['item']);
@@ -209,8 +212,7 @@ EOF;
// get the raw openbgpd confi file for manual inspection/editing
function openbgpd_get_raw_config() {
- global $bgpd_config_base;
- $conf = "{$bgpd_config_base}/bgpd.conf";
+ $conf = PKG_BGPD_CONFIG_BASE . "/bgpd.conf";
if (file_exists($conf))
return file_get_contents($conf);
else
diff --git a/config/quagga_ospfd/quagga_ospfd.inc b/config/quagga_ospfd/quagga_ospfd.inc
index ecca4b71..71dfc886 100644
--- a/config/quagga_ospfd/quagga_ospfd.inc
+++ b/config/quagga_ospfd/quagga_ospfd.inc
@@ -28,7 +28,8 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-$quagga_config_base = "/var/etc/quagga";
+define('PKG_QUAGGA_CONFIG_BASE', '/var/etc/quagga');
+
$pkg_login = "quagga";
$pkg_uid = "101";
$pkg_group = "quagga";
@@ -63,9 +64,11 @@ function quagga_ospfd_get_interfaces() {
}
function quagga_ospfd_install_conf() {
- global $config, $g, $input_errors, $quagga_config_base, $pkg_login, $pkg_uid, $pkg_group, $pkg_gid, $pkg_gecos, $pkg_homedir, $pkg_shell;
+ global $config, $g, $input_errors, $pkg_login, $pkg_uid, $pkg_group, $pkg_gid, $pkg_gecos, $pkg_homedir, $pkg_shell;
conf_mount_rw();
+ // Since we need to embed this in a string, copy to a var. Can't embed constnats.
+ $quagga_config_base = PKG_QUAGGA_CONFIG_BASE;
if ($config['installedpackages']['quaggaospfd']['rawconfig'] && $config['installedpackages']['quaggaospfd']['rawconfig']['item']) {
// if there is a raw config specifyed in tthe config.xml use that instead of the assisted config
@@ -310,7 +313,7 @@ function quagga_ospfd_validate_input() {
// get the raw ospfd confi file for manual inspection/editing
function quagga_ospfd_get_raw_config() {
- return file_get_contents("{$quagga_config_base}/ospfd.conf");
+ return file_get_contents(PKG_QUAGGA_CONFIG_BASE . "/ospfd.conf");
}
// serialize the raw ospfd confi file to config.xml