aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2015-04-27 13:18:54 -0300
committerRenato Botelho <garga@FreeBSD.org>2015-04-27 13:18:54 -0300
commit21a1be9fa7babd250a158e9f6908f51b0d7f67d5 (patch)
tree25175a655b6e4ff67d4c9b2b1d8013597d2d986a /config
parent06e99aa586dc4852251657908c6af8173a423974 (diff)
downloadpfsense-packages-21a1be9fa7babd250a158e9f6908f51b0d7f67d5.tar.gz
pfsense-packages-21a1be9fa7babd250a158e9f6908f51b0d7f67d5.tar.bz2
pfsense-packages-21a1be9fa7babd250a158e9f6908f51b0d7f67d5.zip
Check if squid is installed before attempt to use LS_SQUIDLOGPATH otherwise this macro won't be defined
Diffstat (limited to 'config')
-rw-r--r--config/lightsquid/lightsquid.inc22
1 files changed, 13 insertions, 9 deletions
diff --git a/config/lightsquid/lightsquid.inc b/config/lightsquid/lightsquid.inc
index c505b401..d816b3c2 100644
--- a/config/lightsquid/lightsquid.inc
+++ b/config/lightsquid/lightsquid.inc
@@ -186,7 +186,9 @@ function lightsquid_resync() {
// variables for update
$lsconf_var[LS_VAR_CFGPATH] = "\"" . LS_CONFIGPATH . "\"";
- $lsconf_var[LS_VAR_LOGPATH] = "\"" . LS_SQUIDLOGPATH . "\"";
+ if (isset($config['installedpackages']['squid']['config'][0])) {
+ $lsconf_var[LS_VAR_LOGPATH] = "\"" . LS_SQUIDLOGPATH . "\"";
+ }
$lsconf_var[LS_VAR_TPLPATH] = "\"" . LS_TEMPLATEPATH . "\"";
$lsconf_var[LS_VAR_LANGPATH] = "\"" . LS_LANGPATH . "\"";
$lsconf_var[LS_VAR_REPORTPATH] = "\"" . LS_REPORTPATH . "\"";
@@ -431,14 +433,16 @@ function refresh_full() {
update_log("refresh_full: execute command '$cmd'");
mwexec_bg("$cmd $log_name");
// parse access.log.x
- for ($i=0; $i<100; $i++) {
- $lg = LS_SQUIDLOG . ".$i";
- if (file_exists(LS_SQUIDLOGPATH . "/$lg")) {
- update_log("refresh_full: execute command '$cmd $lg'");
- mwexec_bg("$cmd $lg");
- } else
- // really go <= 10 cycles
- break;
+ if (isset($config['installedpackages']['squid']['config'][0])) {
+ for ($i=0; $i<100; $i++) {
+ $lg = LS_SQUIDLOG . ".$i";
+ if (file_exists(LS_SQUIDLOGPATH . "/$lg")) {
+ update_log("refresh_full: execute command '$cmd $lg'");
+ mwexec_bg("$cmd $lg");
+ } else
+ // really go <= 10 cycles
+ break;
+ }
}
update_log("refresh_full: stop");
}