diff options
author | jim-p <jimp@pfsense.org> | 2012-06-12 13:03:06 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2012-06-12 13:03:43 -0400 |
commit | 6bb71486a512f80809480104ef43c6df880e46de (patch) | |
tree | 81f09318a77ddf0a62e90b813173e99ba34e179f | |
parent | a4e57c984c9970da5f0a4fb1c4bf58718d8901d3 (diff) | |
download | pfsense-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.
-rw-r--r-- | config/lightsquid/lightsquid.inc | 12 |
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;"; |