From e936ec53eeea5c41c4b53459c8f5954f84cd2bad Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Tue, 28 Apr 2015 10:07:23 -0300 Subject: Fix pbi detection on freeradius2 --- config/freeradius2/freeradius.inc | 5 ++++- config/freeradius2/freeradius_view_config.php | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'config/freeradius2') diff --git a/config/freeradius2/freeradius.inc b/config/freeradius2/freeradius.inc index 00076816..a094853a 100644 --- a/config/freeradius2/freeradius.inc +++ b/config/freeradius2/freeradius.inc @@ -48,7 +48,10 @@ require_once("services.inc"); // Check pfSense version $pfs_version = substr(trim(file_get_contents("/etc/version")),0,3); -define('FREERADIUS_BASE', '/usr/pbi/freeradius-' . php_uname("m")); +if ($pfs_version == "2.1" || $pfs_version == "2.2") + define('FREERADIUS_BASE', '/usr/pbi/freeradius-' . php_uname("m")); +else + define('FREERADIUS_BASE', '/usr/local'); $bash_path = FREERADIUS_BASE . "/bin/bash"; if ($pfs_version == "2.1") { diff --git a/config/freeradius2/freeradius_view_config.php b/config/freeradius2/freeradius_view_config.php index b2959783..0095b009 100644 --- a/config/freeradius2/freeradius_view_config.php +++ b/config/freeradius2/freeradius_view_config.php @@ -33,10 +33,13 @@ require("guiconfig.inc"); // Check to find out on which system the package is running -if (substr(trim(file_get_contents("/etc/version")),0,3) == "2.1") { +$pfs_version = substr(trim(file_get_contents("/etc/version")),0,3); +if ($pfs_version == "2.1") { define('RADDB', '/usr/pbi/freeradius-' . php_uname("m") . '/etc/raddb'); -} else { +} else if ($pfs_version == "2.1") { define('RADDB', '/usr/pbi/freeradius-' . php_uname("m") . '/local/etc/raddb'); +} else { + define('RADDB', '/usr/local/etc/raddb'); } // End of system check -- cgit v1.2.3