From 3edf82c8beb2e032a2f82250f6d5011856ddf62c Mon Sep 17 00:00:00 2001 From: jim-p Date: Tue, 22 Jun 2010 17:11:32 -0400 Subject: Refactor this code a little, and wait a few seconds before kicking off a filter sync in case squid hasn't had a chance to kick in fully. --- config/squid/squid.inc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'config') diff --git a/config/squid/squid.inc b/config/squid/squid.inc index f804ef87..e4bb1e58 100644 --- a/config/squid/squid.inc +++ b/config/squid/squid.inc @@ -1125,6 +1125,8 @@ function squid_resync() { mwexec("/usr/local/sbin/squid -k reconfigure"); } + // Sleep for a couple seconds to give squid a chance to fire up fully. + sleep(5); filter_configure(); conf_mount_ro(); } @@ -1256,12 +1258,13 @@ function squid_generate_rules($type) { global $config; $squid_conf = $config['installedpackages']['squid']['config'][0]; - if (!is_service_running('squid')) { - log_error("SQUID is installed but not started. Not installing redirect rules."); + + if (($squid_conf['transparent_proxy'] != 'on') || ($squid_conf['allow_interface'] != 'on')) { return; } - if (($squid_conf['transparent_proxy'] != 'on') || ($squid_conf['allow_interface'] != 'on')) { + if (!is_service_running('squid')) { + log_error("SQUID is installed but not started. Not installing \"{$type}\" rules."); return; } -- cgit v1.2.3