aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorccesario <carloscesario@gmail.com>2013-10-02 14:29:26 -0300
committerccesario <carloscesario@gmail.com>2013-10-02 14:29:26 -0300
commit0c520127b661d64286f0095f18a47bd06a14547b (patch)
treecbca8e31b91d0950ed254036e154345f16adaf1c
parent30012ddf4bd78090db45bcb53e55cc1955cf1d39 (diff)
downloadpfsense-packages-0c520127b661d64286f0095f18a47bd06a14547b.tar.gz
pfsense-packages-0c520127b661d64286f0095f18a47bd06a14547b.tar.bz2
pfsense-packages-0c520127b661d64286f0095f18a47bd06a14547b.zip
Added function to get squidGuard directory, because each squidGuard version has a different directory
-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"));
}