aboutsummaryrefslogtreecommitdiffstats
path: root/packages/squid.xml
diff options
context:
space:
mode:
authorColin Smith <colin@pfsense.org>2005-03-19 23:11:01 +0000
committerColin Smith <colin@pfsense.org>2005-03-19 23:11:01 +0000
commitbc688c6576ea67529de4bb7cabb91a2e258d7fc6 (patch)
treedd0e8e78815de01f04b7d922014f30c37143ffa8 /packages/squid.xml
parent3451603f205a2a6b526f0384b2fc1f903255c098 (diff)
downloadpfsense-packages-bc688c6576ea67529de4bb7cabb91a2e258d7fc6.tar.gz
pfsense-packages-bc688c6576ea67529de4bb7cabb91a2e258d7fc6.tar.bz2
pfsense-packages-bc688c6576ea67529de4bb7cabb91a2e258d7fc6.zip
Move write_squid_static_config() from installation XML to add XML (to make sure it is decalred before use).
Diffstat (limited to 'packages/squid.xml')
-rw-r--r--packages/squid.xml64
1 files changed, 32 insertions, 32 deletions
diff --git a/packages/squid.xml b/packages/squid.xml
index 5a5f63e7..313bfef7 100644
--- a/packages/squid.xml
+++ b/packages/squid.xml
@@ -20,6 +20,38 @@
</field>
</fields>
<custom_add_php_command>
+ function write_squid_static_config() {
+ global $config;
+ $lancfg = $config['interfaces']['lan'];
+ $lanif = $lancfg['if'];
+ $lanip = $lancfg['ipaddr'];
+ $lansa = gen_subnet($lancfg['ipaddr'], $lancfg['subnet']);
+ $lansn = $lancfg['subnet'];
+ $fout = fopen("/usr/local/etc/squid/squid.conf","w");
+ fwrite($fout, "#\n");
+ fwrite($fout, "# This file was automatically generated by the pfSense package manager\n");
+ fwrite($fout, "#\n");
+ fwrite($fout, "http_port 3128\n");
+ fwrite($fout, "icp_port 0\n");
+ fwrite($fout, "acl localnet src " . $lansa . "/" . $lansn . "\n");
+ fwrite($fout, "acl all src " . $lansa . "/" . $lansn . "\n");
+ fwrite($fout, "acl localhost src 127.0.0.1/255.255.255.255\n");
+ fwrite($fout, "acl Safe_ports port 80 443 210 119 70 21 1025-65535\n");
+ fwrite($fout, "acl CONNECT method CONNECT\n");
+ fwrite($fout, "http_access allow localnet\n");
+ fwrite($fout, "http_access allow localhost\n");
+ fwrite($fout, "http_access deny !Safe_ports\n");
+ fwrite($fout, "http_access deny CONNECT\n");
+ fwrite($fout, "http_access deny all\n");
+ fwrite($fout, "visible_hostname pfSense\n");
+ fwrite($fout, "httpd_accel_host virtual\n");
+ fwrite($fout, "httpd_accel_port 80\n");
+ fwrite($fout, "httpd_accel_with_proxy on\n");
+ fwrite($fout, "httpd_accel_uses_host_header on\n");
+ fwrite($fout, "cache_effective_user squid\n");
+ fwrite($fout, "cache_effective_group squid\n");
+ fclose($fout);
+ }
function sync_package_squid() {
conf_mount_rw();
config_lock();
@@ -36,38 +68,6 @@
sync_package_squid();
</custom_add_php_command>
<custom_php_install_command>
- function write_squid_static_config() {
- global $config;
- $lancfg = $config['interfaces']['lan'];
- $lanif = $lancfg['if'];
- $lanip = $lancfg['ipaddr'];
- $lansa = gen_subnet($lancfg['ipaddr'], $lancfg['subnet']);
- $lansn = $lancfg['subnet'];
- $fout = fopen("/usr/local/etc/squid/squid.conf","w");
- fwrite($fout, "#\n");
- fwrite($fout, "# This file was automatically generated by the pfSense package manager\n");
- fwrite($fout, "#\n");
- fwrite($fout, "http_port 3128\n");
- fwrite($fout, "icp_port 0\n");
- fwrite($fout, "acl localnet src " . $lansa . "/" . $lansn . "\n");
- fwrite($fout, "acl all src " . $lansa . "/" . $lansn . "\n");
- fwrite($fout, "acl localhost src 127.0.0.1/255.255.255.255\n");
- fwrite($fout, "acl Safe_ports port 80 443 210 119 70 21 1025-65535\n");
- fwrite($fout, "acl CONNECT method CONNECT\n");
- fwrite($fout, "http_access allow localnet\n");
- fwrite($fout, "http_access allow localhost\n");
- fwrite($fout, "http_access deny !Safe_ports\n");
- fwrite($fout, "http_access deny CONNECT\n");
- fwrite($fout, "http_access deny all\n");
- fwrite($fout, "visible_hostname pfSense\n");
- fwrite($fout, "httpd_accel_host virtual\n");
- fwrite($fout, "httpd_accel_port 80\n");
- fwrite($fout, "httpd_accel_with_proxy on\n");
- fwrite($fout, "httpd_accel_uses_host_header on\n");
- fwrite($fout, "cache_effective_user squid\n");
- fwrite($fout, "cache_effective_group squid\n");
- fclose($fout);
- }
write_squid_static_config();
$fout = fopen("/usr/local/etc/rc.d/squid.sh","w");
fwrite($fout, "#!/bin/sh\n");