diff options
author | bruno <bruno.stein@bluepex.com> | 2016-09-05 14:46:30 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2016-09-13 09:52:10 -0300 |
commit | 2325f87d53326a162ed5d222b9e063412ce37522 (patch) | |
tree | 5dc5c563088d687d67aa314841067a90a660f9a5 | |
parent | 8e85463c17621df8cbbab8c85fd815b22c22d3d3 (diff) | |
download | FreeBSD-ports-2325f87d53326a162ed5d222b9e063412ce37522.zip FreeBSD-ports-2325f87d53326a162ed5d222b9e063412ce37522.tar.gz |
converted raw config to base64 encode
(cherry picked from commit 4c381248d18e2f65d097cb58a82069d204294ffa)
-rw-r--r-- | net/pfSense-pkg-OpenBGPD/files/usr/local/pkg/openbgpd.inc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/net/pfSense-pkg-OpenBGPD/files/usr/local/pkg/openbgpd.inc b/net/pfSense-pkg-OpenBGPD/files/usr/local/pkg/openbgpd.inc index 6c4a485..df48740 100644 --- a/net/pfSense-pkg-OpenBGPD/files/usr/local/pkg/openbgpd.inc +++ b/net/pfSense-pkg-OpenBGPD/files/usr/local/pkg/openbgpd.inc @@ -57,7 +57,13 @@ function openbgpd_install_conf() { // Since we need to embed this in a string, copy to a var. Can't embed constants. $bgpd_config_base = PKG_BGPD_CONFIG_BASE; - if (isset($config['installedpackages']['openbgpd']['rawconfig']) && !empty($config['installedpackages']['openbgpd']['rawconfig'])) { + + // Convert raw config to base64 encode + if (isset($config['installedpackages']['openbgpd']['rawconfig']['item']) && !empty($config['installedpackages']['openbgpd']['rawconfig']['item'])) { + $conffile = implode("\n", $config['installedpackages']['openbgpd']['rawconfig']['item']); + $config['installedpackages']['openbgpd']['rawconfig'] = base64_encode($conffile); + write_config("Converted OpenBGPD raw config to base64 encode..."); + } elseif (isset($config['installedpackages']['openbgpd']['rawconfig']) && !empty($config['installedpackages']['openbgpd']['rawconfig'])) { // If there is a raw config specified in the config.xml, use that instead of the assisted config $conffile = base64_decode($config['installedpackages']['openbgpd']['rawconfig']); } else { |