aboutsummaryrefslogtreecommitdiffstats
path: root/config/squid
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2010-06-22 17:11:32 -0400
committerjim-p <jimp@pfsense.org>2010-06-22 17:11:32 -0400
commit3edf82c8beb2e032a2f82250f6d5011856ddf62c (patch)
tree64ea570e3ccbe7c48e676edc0990c411bb9e9d71 /config/squid
parent763bd7cf43b6550a068b8b24b27a07a2a3eab8a1 (diff)
downloadpfsense-packages-3edf82c8beb2e032a2f82250f6d5011856ddf62c.tar.gz
pfsense-packages-3edf82c8beb2e032a2f82250f6d5011856ddf62c.tar.bz2
pfsense-packages-3edf82c8beb2e032a2f82250f6d5011856ddf62c.zip
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.
Diffstat (limited to 'config/squid')
-rw-r--r--config/squid/squid.inc9
1 files changed, 6 insertions, 3 deletions
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;
}