aboutsummaryrefslogtreecommitdiffstats
path: root/packages/squid.inc
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@xs4all.nl>2006-12-19 20:00:28 +0000
committerSeth Mos <seth.mos@xs4all.nl>2006-12-19 20:00:28 +0000
commitf42b91659860411c77c0f53ced09ed835c7478a0 (patch)
treea5132db721cd32cf2328896a3af9f54dc7d1f14c /packages/squid.inc
parentf5e2a7376d8dffc1e7c1760eae64fcef58e3a461 (diff)
downloadpfsense-packages-f42b91659860411c77c0f53ced09ed835c7478a0.tar.gz
pfsense-packages-f42b91659860411c77c0f53ced09ed835c7478a0.tar.bz2
pfsense-packages-f42b91659860411c77c0f53ced09ed835c7478a0.zip
Smoldering wreck. Please test.
Diffstat (limited to 'packages/squid.inc')
-rw-r--r--packages/squid.inc53
1 files changed, 31 insertions, 22 deletions
diff --git a/packages/squid.inc b/packages/squid.inc
index 7264e5e5..bab0f788 100644
--- a/packages/squid.inc
+++ b/packages/squid.inc
@@ -121,8 +121,11 @@ EOD;
}
/* kill any running proxy alarm scripts */
+ log_error("Stopping any running proxy monitors");
mwexec("ps awux | grep \"proxy_monitor\" | grep -v \"grep\" | grep -v \"php\" | awk '{ print $2 }' | xargs kill");
+ sleep(1);
/* restart proxy alarm scripts */
+ log_error("Starting a proxy monitor script");
mwexec_bg("/usr/local/etc/rc.d/proxy_monitor.sh");
if (!file_exists(SQUID_CONFBASE . '/mime.conf') && file_exists(SQUID_CONFBASE . '/mime.conf.default'))
@@ -388,10 +391,14 @@ EOD;
}
+ log_error("Reloading squid configuration");
+ mwexec("/usr/local/sbin/squid -k reconfigure");
/* kill any running proxy alarm scripts */
- mwexec("ps awux | grep \"proxy_monitor\" | grep -v \"grep\" | grep -v \"php\" | awk '{ print $2 }' | xargs kill");
+ // log_error("Stopping proxy monitor script");
+ // mwexec("ps awux | grep \"proxy_monitor\" | grep -v \"grep\" | grep -v \"php\" | awk '{ print $2 }' | xargs kill");
/* restart proxy alarm scripts */
- mwexec_bg("/usr/local/etc/rc.d/proxy_monitor.sh");
+ // log_error("Starting proxy monitor script");
+ // mwexec_bg("/usr/local/etc/rc.d/proxy_monitor.sh");
return $conf;
}
@@ -729,23 +736,26 @@ function squid_resync() {
exec("/usr/local/sbin/squid -z");
}
+ // log_error("Stopping proxy monitor script");
/* kill any running proxy alarm scripts */
- mwexec("ps awux | grep \"proxy_monitor\" | grep -v \"grep\" | grep -v \"php\" | awk '{ print $2 }' | xargs kill");
- /* restart proxy alarm scripts */
- mwexec_bg("/usr/local/etc/rc.d/proxy_monitor.sh");
+ // mwexec("ps awux | grep \"proxy_monitor\" | grep -v \"grep\" | grep -v \"php\" | awk '{ print $2 }' | xargs kill");
- sleep(1);
+ // restart_service('squid');
+ // log_error("Stopping Squid for configuration sync");
+ // mwexec("/usr/local/sbin/squid -k shutdown");
+ // sleep (5);
+ // mwexec("killall -9 squid");
- restart_service('squid');
- /*
- mwexec("/usr/local/sbin/squid -k shutdown");
- sleep (5);
- mwexec("killall -9 squid");
- sleep(1);
- mwexec_bg("/usr/local/sbin/squid -D");
- */
+ log_error("Reloading Squid for configuration sync");
+ mwexec("/usr/local/sbin/squid -k reconfigure");
+
+ // log_error("Starting Squid for configuration sync");
+ // mwexec_bg("/usr/local/sbin/squid -D");
+
+ // log_error("Starting monitor script");
+ /* restart proxy alarm scripts */
+ // mwexec_bg("/usr/local/etc/rc.d/proxy_monitor.sh");
- sleep(1);
filter_configure();
}
@@ -869,11 +879,6 @@ function squid_generate_rules($type) {
return;
}
- if($squid_conf['proxy_port'])
- $port = $squid_conf['proxy_port'];
- else
- $port = "3128";
-
if (($squid_conf['transparent_proxy'] != 'on') || ($squid_conf['allow_interface'] != 'on')) {
return;
}
@@ -884,11 +889,15 @@ function squid_generate_rules($type) {
switch($type) {
case 'nat':
foreach ($ifaces as $iface)
- $rules .= "rdr on $iface proto tcp from any to !($iface) port 80 -> ($iface) port $port\n";
+ $rules .= "# Setup Squid transparent proxy redirect\n";
+ $rules .= "rdr on $iface proto tcp from any to !($iface) port 80 -> ($iface) port 80\n";
+ $rules .= "\n";
break;
case 'filter':
foreach ($ifaces as $iface)
- $rules .= "pass quick on $iface proto tcp from any to !($iface) port 80 flags S/SA keep state\n";
+ $rules .= "# Setup squid pass rules for transparent proxy\n";
+ $rules .= "pass in quick on $iface proto tcp from any to !($iface) port 80 flags S/SA keep state\n";
+ $rules .= "\n";
break;
default:
break;