aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-07-29 21:28:35 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-07-29 21:28:35 +0000
commite80d387f9ac10df4037f977c6cd1fcca1fa44c38 (patch)
treecaeee01730e831d867e90c8122ef34401ff5e200 /packages
parent8bc1b9cc76735b463a070cd721e9a52b4a2e4f61 (diff)
downloadpfsense-packages-e80d387f9ac10df4037f977c6cd1fcca1fa44c38.tar.gz
pfsense-packages-e80d387f9ac10df4037f977c6cd1fcca1fa44c38.tar.bz2
pfsense-packages-e80d387f9ac10df4037f977c6cd1fcca1fa44c38.zip
Create squid cache when needed
Diffstat (limited to 'packages')
-rw-r--r--packages/squid.inc27
1 files changed, 17 insertions, 10 deletions
diff --git a/packages/squid.inc b/packages/squid.inc
index 670c8985..9c359dca 100644
--- a/packages/squid.inc
+++ b/packages/squid.inc
@@ -27,20 +27,20 @@ function squid_get_real_interface_address($iface) {
}
function squid_chown_recursive($dir, $user, $group) {
- chown($dir, $user);
- chgrp($dir, $group);
- $handle = opendir($dir) ;
- while (($item = readdir($handle)) !== false) {
- if (($item != ".") && ($item != "..")) {
+ chown($dir, $user);
+ chgrp($dir, $group);
+ $handle = opendir($dir) ;
+ while (($item = readdir($handle)) !== false) {
+ if (($item != ".") && ($item != "..")) {
$path = "$dir/$item";
if (is_dir($path))
- squid_chown_recursive($path, $user, $group);
+ squid_chown_recursive($path, $user, $group);
else {
- chown($path, $user);
- chgrp($path, $group);
+ chown($path, $user);
+ chgrp($path, $group);
}
- }
- }
+ }
+ }
}
function squid_is_valid_acl($acl) {
@@ -82,6 +82,10 @@ EOD;
if (!file_exists(SQUID_CONFBASE . '/mime.conf') && file_exists(SQUID_CONFBASE . '/mime.conf.default'))
copy(SQUID_CONFBASE . '/mime.conf.default', SQUID_CONFBASE . '/mime.conf');
+
+ if(!is_dir("/var/squid/cache/"))
+ exec("squid -z");
+
}
function squid_deinstall_command() {
@@ -322,6 +326,9 @@ EOD;
$valid_acls[] = 'localnet';
}
+ if(!is_dir("/var/squid/cache/"))
+ exec("squid -z");
+
return $conf;
}