From 3def54fa50ce6050c0bb2e12e7c4a115266c4018 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Thu, 23 Apr 2015 08:36:05 -0300 Subject: Add run_depends and port_category to pfBlockerNG, also teach it to deal with non-PBI paths --- config/pfblockerng/pfblockerng_alerts.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'config/pfblockerng/pfblockerng_alerts.php') diff --git a/config/pfblockerng/pfblockerng_alerts.php b/config/pfblockerng/pfblockerng_alerts.php index c67420b9..0b251295 100644 --- a/config/pfblockerng/pfblockerng_alerts.php +++ b/config/pfblockerng/pfblockerng_alerts.php @@ -60,14 +60,22 @@ require_once("/usr/local/pkg/pfblockerng/pfblockerng.inc"); global $rule_list; pfb_global(); +$pfs_version = substr(trim(file_get_contents("/etc/version")),0,3); + +if ($pfs_version == "2.2") { + $prefix = "/usr/pbi/pfblockerng-" . php_uname("m"); +} else { + $prefix = "/usr/local"; +} + // Application Paths -$pathgeoip = "/usr/pbi/pfblockerng-" . php_uname("m") . "/bin/geoiplookup"; -$pathgeoip6 = "/usr/pbi/pfblockerng-" . php_uname("m") . "/bin/geoiplookup6"; +$pathgeoip = $prefix . "/bin/geoiplookup"; +$pathgeoip6 = $prefix . "/bin/geoiplookup6"; // Define File Locations $filter_logfile = "{$g['varlog_path']}/filter.log"; -$pathgeoipdat = "/usr/pbi/pfblockerng-" . php_uname("m") . "/share/GeoIP/GeoIP.dat"; -$pathgeoipdat6 = "/usr/pbi/pfblockerng-" . php_uname("m") . "/share/GeoIP/GeoIPv6.dat"; +$pathgeoipdat = $prefix . "/share/GeoIP/GeoIP.dat"; +$pathgeoipdat6 = $prefix . "/share/GeoIP/GeoIPv6.dat"; // Define Alerts Log filter Rollup window variable. (Alert Filtering Code adapted from B.Meeks - Snort Package) $pfb['filterlogentries'] = FALSE; @@ -1006,4 +1014,4 @@ function enable_hideFilter() { - \ No newline at end of file + -- cgit v1.2.3