aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim P <jim@pingle.org>2013-10-02 10:31:51 -0700
committerJim P <jim@pingle.org>2013-10-02 10:31:51 -0700
commit1fc91f00ea55482269dfb6e38385d381e119da8f (patch)
tree5541b46abdadaf32a47fd6ee66dfaa189e133ca0
parent5759df034e190b268f4acc6be31ce0e15604cbc6 (diff)
parent0c520127b661d64286f0095f18a47bd06a14547b (diff)
downloadpfsense-packages-1fc91f00ea55482269dfb6e38385d381e119da8f.tar.gz
pfsense-packages-1fc91f00ea55482269dfb6e38385d381e119da8f.tar.bz2
pfsense-packages-1fc91f00ea55482269dfb6e38385d381e119da8f.zip
Merge pull request #521 from ccesario/master
Added function to get squidGuard directory, because each squidGuard vers...
-rw-r--r--config/sarg/sarg.inc14
1 files changed, 13 insertions, 1 deletions
diff --git a/config/sarg/sarg.inc b/config/sarg/sarg.inc
index 499c1973..0a66137b 100644
--- a/config/sarg/sarg.inc
+++ b/config/sarg/sarg.inc
@@ -33,8 +33,20 @@
/* ========================================================================== */
$pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
if ($pf_version > 2.0){
+
+ // Function to get squidGuard directory
+ // each squidGuard version has a different directory
+ function getsqGuardDir() {
+ foreach (glob("/usr/pbi/*",GLOB_ONLYDIR) as $dirname) {
+ if (preg_match("/squidguard-/i", $dirname)) {
+ return trim($dirname);
+ break;
+ }
+ }
+ }
+
define('SARG_DIR', '/usr/pbi/sarg-' . php_uname("m"));
- define('SQGARD_DIR','/usr/pbi/squidguard-' . php_uname("m"));
+ define('SQGARD_DIR', getsqGuardDir());
define('SQUID_DIR', '/usr/pbi/squid-' . php_uname("m"));
define('DANSG_DIR', '/usr/pbi/dansguardian-' . php_uname("m"));
}