From 0c520127b661d64286f0095f18a47bd06a14547b Mon Sep 17 00:00:00 2001 From: ccesario Date: Wed, 2 Oct 2013 14:29:26 -0300 Subject: Added function to get squidGuard directory, because each squidGuard version has a different directory --- config/sarg/sarg.inc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'config/sarg') 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")); } -- cgit v1.2.3