aboutsummaryrefslogtreecommitdiffstats
path: root/config/sarg
diff options
context:
space:
mode:
Diffstat (limited to 'config/sarg')
-rw-r--r--config/sarg/sarg.inc16
1 files changed, 14 insertions, 2 deletions
diff --git a/config/sarg/sarg.inc b/config/sarg/sarg.inc
index 97abc138..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"));
}
@@ -142,7 +154,7 @@ EOF;
}
#create a new file to speedup find search
file_put_contents("/root/sarg_run_{$id}.sh",$gzip_script,LOCK_EX);
- mwexec($cmd. " ".$args);
+ mwexec("export LC_ALL=C && " .$cmd. " ".$args);
#check if there is a script to run after file save
if (is_array($config['installedpackages']['sarg']))
switch ($config['installedpackages']['sarg']['config'][0]['proxy_server']){