diff options
author | bmeeks8 <bmeeks8@bellsouth.net> | 2013-12-12 18:11:25 -0500 |
---|---|---|
committer | bmeeks8 <bmeeks8@bellsouth.net> | 2013-12-12 18:11:25 -0500 |
commit | 14536b69664b95b05603ba256c0dc99f3de5846a (patch) | |
tree | a52a2f8777f5e459cae50320958c5bb73b0008c5 | |
parent | bab500c5b766bb7c7692c5f3d38cc550a974dc9f (diff) | |
download | pfsense-packages-14536b69664b95b05603ba256c0dc99f3de5846a.tar.gz pfsense-packages-14536b69664b95b05603ba256c0dc99f3de5846a.tar.bz2 pfsense-packages-14536b69664b95b05603ba256c0dc99f3de5846a.zip |
Simplify the way a PBI install is determined.
-rwxr-xr-x | config/snort/snort.inc | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/config/snort/snort.inc b/config/snort/snort.inc index 62ca2eec..c71c0d0c 100755 --- a/config/snort/snort.inc +++ b/config/snort/snort.inc @@ -52,17 +52,13 @@ $snort_version = $snortver[0]; /* package version */ $pfSense_snort_version = "3.0.0"; -$snort_package_version = "Snort {$snort_version} pkg v. {$pfSense_snort_version}"; - -// Define SNORTDIR and SNORTLIBDIR constants according to FreeBSD version (PBI support or no PBI) -if (floatval(php_uname("r")) >= 8.3) { - exec("/usr/local/sbin/pbi_info | grep 'snort-{$snort_version}' | xargs /usr/local/sbin/pbi_info | awk '/Prefix/ {print $2}'",$pbidirarray); - $snort_pbidir = "{$pbidirarray[0]}"; - /* In case this is an initial Snort install and pbi_info() above returned null, set a sane default value */ - if (empty($snort_pbidir)) - $snort_pbidir = "/usr/pbi/snort-" . php_uname("m"); - define("SNORTDIR", "{$snort_pbidir}/etc/snort"); - define("SNORTLIBDIR", "{$snort_pbidir}/lib/snort"); +$snort_package_version = "Snort {$snort_version} pkg v{$pfSense_snort_version}"; + +// Define SNORTDIR and SNORTLIBDIR constants according to pfSense version +$pfs_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pfs_version > 2.0) { + define("SNORTDIR", "/usr/pbi/snort-" . php_uname("m") . "/etc/snort"); + define("SNORTLIBDIR", "/usr/pbi/snort-" . php_uname("m") . "/lib/snort"); } else { define("SNORTDIR", "/usr/local/etc/snort"); |