aboutsummaryrefslogtreecommitdiffstats
path: root/config/pfblockerng/pfblockerng.inc
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2015-04-23 08:36:05 -0300
committerRenato Botelho <garga@FreeBSD.org>2015-04-23 08:36:05 -0300
commit3def54fa50ce6050c0bb2e12e7c4a115266c4018 (patch)
tree123e21583ccfc10e57fbdc63916a9c7ccad2a904 /config/pfblockerng/pfblockerng.inc
parent799a01526591806f344e56556e21106130ec01df (diff)
downloadpfsense-packages-3def54fa50ce6050c0bb2e12e7c4a115266c4018.tar.gz
pfsense-packages-3def54fa50ce6050c0bb2e12e7c4a115266c4018.tar.bz2
pfsense-packages-3def54fa50ce6050c0bb2e12e7c4a115266c4018.zip
Add run_depends and port_category to pfBlockerNG, also teach it to deal with non-PBI paths
Diffstat (limited to 'config/pfblockerng/pfblockerng.inc')
-rw-r--r--config/pfblockerng/pfblockerng.inc14
1 files changed, 11 insertions, 3 deletions
diff --git a/config/pfblockerng/pfblockerng.inc b/config/pfblockerng/pfblockerng.inc
index 1a1c87a2..18e22871 100644
--- a/config/pfblockerng/pfblockerng.inc
+++ b/config/pfblockerng/pfblockerng.inc
@@ -50,6 +50,14 @@ require_once("services.inc");
function pfb_global() {
global $g,$config,$pfb;
+ $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";
+ }
+
# Collect pfSense Version
$pfb['pfsenseversion'] = substr(trim(file_get_contents("/etc/version")),0,3);
@@ -63,7 +71,7 @@ function pfb_global() {
$pfb['matchdir'] = "{$pfb['dbdir']}/match";
$pfb['permitdir'] = "{$pfb['dbdir']}/permit";
$pfb['origdir'] = "{$pfb['dbdir']}/original";
- $pfb['ccdir'] = "/usr/pbi/pfblockerng-" . php_uname("m") . "/share/GeoIP";
+ $pfb['ccdir'] = $prefix . "/share/GeoIP";
# Create Folders if not Exist.
$folder_array = array ("{$pfb['dbdir']}","{$pfb['logdir']}","{$pfb['ccdir']}","{$pfb['origdir']}","{$pfb['nativedir']}","{$pfb['denydir']}","{$pfb['matchdir']}","{$pfb['permitdir']}","{$pfb['aliasdir']}");
@@ -78,7 +86,7 @@ function pfb_global() {
$pfb['log'] = "{$pfb['logdir']}/pfblockerng.log";
$pfb['supptxt'] = "{$pfb['dbdir']}/pfbsuppression.txt";
$pfb['script'] = 'sh /usr/local/pkg/pfblockerng/pfblockerng.sh';
- $pfb['aliasarchive'] = "/usr/pbi/pfblockerng-" . php_uname("m") . "/etc/aliastables.tar.bz2";
+ $pfb['aliasarchive'] = $prefix . "/etc/aliastables.tar.bz2";
# General Variables
$pfb['config'] = $config['installedpackages']['pfblockerng']['config'][0];
@@ -2701,4 +2709,4 @@ function pfblockerng_do_xmlrpc_sync($sync_to_ip, $port, $protocol, $username, $p
}
return $success;
}
-?> \ No newline at end of file
+?>