aboutsummaryrefslogtreecommitdiffstats
path: root/packages/squid_ng.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-02-04 03:20:11 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-02-04 03:20:11 +0000
commit67d874323d4a78a9a0ee87bb2fcdad055c8fdd15 (patch)
tree35b88fb0cf2171e7ae410b16a93d96fa54f1d7bd /packages/squid_ng.inc
parent96beb0395e634170237f6d644c1df0f84370336b (diff)
downloadpfsense-packages-67d874323d4a78a9a0ee87bb2fcdad055c8fdd15.tar.gz
pfsense-packages-67d874323d4a78a9a0ee87bb2fcdad055c8fdd15.tar.bz2
pfsense-packages-67d874323d4a78a9a0ee87bb2fcdad055c8fdd15.zip
Setup persistent items across reboot for squid
Diffstat (limited to 'packages/squid_ng.inc')
-rw-r--r--packages/squid_ng.inc30
1 files changed, 23 insertions, 7 deletions
diff --git a/packages/squid_ng.inc b/packages/squid_ng.inc
index ad33d2bb..b54257d9 100644
--- a/packages/squid_ng.inc
+++ b/packages/squid_ng.inc
@@ -759,7 +759,7 @@ function global_write_squid_config()
foreach ($config_array as $config_item)
{
fwrite($fout, trim($config_item));
-
+
if (stristr($config_item, "\n"))
{
for ($i = 1; $i < count(explode("\n", $config_item)); $i++)
@@ -782,7 +782,7 @@ function custom_php_install_command() {
write_static_squid_config();
touch("/tmp/custom_php_install_command");
-
+
/* make sure this all exists, see:
* http://forum.pfsense.org/index.php?topic=23.msg2391#msg2391
*/
@@ -804,10 +804,25 @@ function custom_php_install_command() {
mwexec("cp /usr/local/etc/squid/mime.conf.default /usr/local/etc/squid/mime.conf");
/* set a few extra items noted by regan */
- mwexec("chown squid:wheel /dev/pf");
- mwexec("chmod ug+rw /dev/pf");
- touch("/var/log/cache.log");
- mwexec("chown squid:wheel /var/log/cache.log");
+ update_output_window("Creating logs and setting user information...");
+ $fdsquid = fopen("/usr/local/etc/rc.d/aSquid.sh");
+ fwrite($fdsquid, "#/bin/sh\n");
+ fwrite($fdsquid, "# \n");
+ fwrite($fdsquid, "# This file was created by the pfSense package system\n");
+ fwrite($fdsquid, "# Sets up squid option on each bootup that are not persistent\n");
+ fwrite($fdsquid, "# \n\n");
+ fwrite($fdsquid, "chown squid:wheel /dev/pf\n");
+ fwrite($fdsquid, "chmod ug+rw /dev/pf\n");
+ fwrite($fdsquid, "touch /var/log/useragent.log\n");
+ fwrite($fdsquid, "touch /var/log/access.log\n");
+ fwrite($fdsquid, "touch /var/log/cache.log\n");
+ fwrite($fdsquid, "chown squid:wheel /var/log/cache.log\n");
+ fwrite($fdsquid, "chown squid:wheel /var/log/access.log\n");
+ fwrite($fdsquid, "chown squid:wheel /var/log/useragent.log\n");
+ fwrite($fdsquid, "\n");
+ fclose($fdsquid);
+ mwexec("chmod a+rx /usr/local/etc/rc.d/aSquid.sh");
+ mwexec("/usr/local/etc/rc.d/aSquid.sh");
update_output_window("Creating Proxy Server initialization scripts...");
$start = <<<EOD
@@ -822,7 +837,7 @@ EOD;
"stop" => $stop
)
);
-
+
mwexec("chmod 755 /usr/local/etc/rc.d/squid.sh");
/* create log directory hierarchies if they don't exist */
@@ -889,6 +904,7 @@ function custom_php_deinstall_command() {
update_output_window("Removing configuration files...");
unlink_if_exists("/usr/local/etc/rc.d/squid.sh");
unlink_if_exists("/usr/local/libexec/squid");
+ unlink_if_exists("/usr/local/etc/rc.d/aSquid.sh");
filter_configure();
}