diff options
Diffstat (limited to 'packages/squid.inc')
-rw-r--r-- | packages/squid.inc | 27 |
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; } |