aboutsummaryrefslogtreecommitdiffstats
path: root/config/lightsquid
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2012-06-12 13:03:06 -0400
committerjim-p <jimp@pfsense.org>2012-06-12 13:03:43 -0400
commit6bb71486a512f80809480104ef43c6df880e46de (patch)
tree81f09318a77ddf0a62e90b813173e99ba34e179f /config/lightsquid
parenta4e57c984c9970da5f0a4fb1c4bf58718d8901d3 (diff)
downloadpfsense-packages-6bb71486a512f80809480104ef43c6df880e46de.tar.gz
pfsense-packages-6bb71486a512f80809480104ef43c6df880e46de.tar.bz2
pfsense-packages-6bb71486a512f80809480104ef43c6df880e46de.zip
Make lightsquid actually respect squid's log directory instead of assuming. Only assume a default if one is not set.
Diffstat (limited to 'config/lightsquid')
-rw-r--r--config/lightsquid/lightsquid.inc12
1 files changed, 10 insertions, 2 deletions
diff --git a/config/lightsquid/lightsquid.inc b/config/lightsquid/lightsquid.inc
index 4e11f678..0b98cfe3 100644
--- a/config/lightsquid/lightsquid.inc
+++ b/config/lightsquid/lightsquid.inc
@@ -49,7 +49,14 @@ define('LS_WWWPATH', '/usr/local/www/lightsquid');
define('LS_TEMPLATEPATH', '/usr/local/www/lightsquid/tpl');
define('LS_LANGPATH', '/usr/local/share/lightsquid/lang');
define('LS_REPORTPATH', '/var/lightsquid/report');
-define('LS_SQUIDLOGPATH', '/var/squid/logs');
+
+global $config;
+if (isset($config['installedpackages']['squid']['config'][0])) {
+ if (!empty($config['installedpackages']['squid']['config'][0]['log_dir']))
+ define('LS_SQUIDLOGPATH', $config['installedpackages']['squid']['config'][0]['log_dir']);
+ else
+ define('LS_SQUIDLOGPATH', '/var/squid/logs');
+}
define('LS_SQUIDLOG', 'access.log');
define('LS_IP2NAMEPATH', '/usr/local/libexec/lightsquid');
@@ -260,7 +267,8 @@ function lightsquid_resync() {
if (isset($config['installedpackages']['squid']['config'][0])) {
$squid_settings = $config['installedpackages']['squid']['config'][0];
$squid_settings['log_enabled'] = 'on';
- $squid_settings['log_dir'] = LS_SQUIDLOGPATH;
+ if (empty($squid_settings['log_dir']))
+ $squid_settings['log_dir'] = LS_SQUIDLOGPATH;
# sqstat
$ifmgr = "127.0.0.1;";