From f798eac369a6c50dad59c68a7ec4ca2c358b8a8f Mon Sep 17 00:00:00 2001 From: "D. V. Serg" Date: Tue, 1 Apr 2008 12:10:44 +0000 Subject: Update resync proc (configuration squid for lightsquid). --- packages/lightsquid/lightsquid.inc | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'packages') diff --git a/packages/lightsquid/lightsquid.inc b/packages/lightsquid/lightsquid.inc index fbdd1dec..6ae3de79 100644 --- a/packages/lightsquid/lightsquid.inc +++ b/packages/lightsquid/lightsquid.inc @@ -33,6 +33,7 @@ require_once('pfsense-utils.inc'); require_once('pkg-utils.inc'); require_once('filter.inc'); require_once('service-utils.inc'); +require_once('squid.inc'); define ('CMD_PKGDELETE', 'pkg_delete lightsquid-1.7.1'); @@ -210,7 +211,7 @@ function lightsquid_resync() { } // set shedule - refresh data job - if ($tm) { + if ($tm) { $on = false; $opt = array("*", "*", "*", "*", "*", "root", CRONTAB_LS_TEMPLATE . " today"); switch($tm) { @@ -230,11 +231,11 @@ function lightsquid_resync() { case 'lhp_24h': $on = true; $opt[0]= "0"; $opt[1]= "0"; $opt[2]= "*/24"; break; } ls_setup_cron("lightsquid_parser", $opt, CRONTAB_LS_JOBKEY, $on); - } else + } else ls_setup_cron("lightsquid_parser", "", "", false); // set shedule - squid rotate - if ($tm_squid) { + if ($tm_squid) { $on = false; $opt = array("0", "0", "*", "*", "*", "root", CRONTAB_SQUID_TEMPLATE); switch($tm_squid) { @@ -261,8 +262,16 @@ function lightsquid_resync() { case 'lsr_w7': $on = true; $opt[4]= "*/1"; break; } ls_setup_cron("lightsquid_squid_rotate", $opt, CRONTAB_SQUID_JOBKEY, $on); - } else + } else ls_setup_cron("lightsquid_squid_rotate", "", "", false); + + // update squid conf + if (isset($config['installedpackages']['squid']['config'][0])) { + $config['installedpackages']['squid']['config'][0]['log_enabled'] = 'on'; + $config['installedpackages']['squid']['config'][0]['log_dir'] = LS_SQUIDLOGPATH; + write_config(); + squid_resync(); + } } if ($_POST['Submit'] === 'Refresh now') refresh_now(); -- cgit v1.2.3