From 52f48c6b5fada33694b614eada1a538c6b8da952 Mon Sep 17 00:00:00 2001 From: "Danilo G. Baio (dbaio)" Date: Sat, 17 Sep 2016 09:17:31 -0300 Subject: [PATCH] pfSense-pkg-OpenBGPD - fix line terminators (raw-config) --- net/pfSense-pkg-OpenBGPD/Makefile | 2 +- net/pfSense-pkg-OpenBGPD/files/usr/local/pkg/openbgpd.inc | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/net/pfSense-pkg-OpenBGPD/Makefile b/net/pfSense-pkg-OpenBGPD/Makefile index 51b851debf2c..7da099852f67 100644 --- a/net/pfSense-pkg-OpenBGPD/Makefile +++ b/net/pfSense-pkg-OpenBGPD/Makefile @@ -2,7 +2,7 @@ PORTNAME= pfSense-pkg-OpenBGPD PORTVERSION= 0.11 -PORTREVISION= 6 +PORTREVISION= 7 CATEGORIES= net MASTER_SITES= # empty DISTFILES= # empty 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 9263ec14374c..94ed693f152a 100644 --- a/net/pfSense-pkg-OpenBGPD/files/usr/local/pkg/openbgpd.inc +++ b/net/pfSense-pkg-OpenBGPD/files/usr/local/pkg/openbgpd.inc @@ -58,6 +58,10 @@ function openbgpd_install_conf() { } 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']); + $conffile = preg_replace("~\r\n~", "\n", $conffile); + if ( substr($conffile,-1) != PHP_EOL ) { + $conffile .= "\n"; + } } else { // Generate bgpd.conf based on the assistant if ($config['installedpackages']['openbgpd']['config']) {