diff options
author | Renato Botelho <renato@netgate.com> | 2015-10-10 10:04:37 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-10-10 10:04:37 -0300 |
commit | 675b121ee2de4c1c430219053a9ba5f0d6a7e568 (patch) | |
tree | e96b7aedee3d802dfbd6e6a7bc96d14e54a473b6 /config/squid3/34/squid.inc | |
parent | 3bd5c2bd64800857ebd86b98668d9d499735c536 (diff) | |
parent | d2d55881b7bd9ed59baae9d7323f6e135f138a0e (diff) | |
download | pfsense-packages-675b121ee2de4c1c430219053a9ba5f0d6a7e568.tar.gz pfsense-packages-675b121ee2de4c1c430219053a9ba5f0d6a7e568.tar.bz2 pfsense-packages-675b121ee2de4c1c430219053a9ba5f0d6a7e568.zip |
Merge pull request #1092 from doktornotor/patch-2
Diffstat (limited to 'config/squid3/34/squid.inc')
-rwxr-xr-x | config/squid3/34/squid.inc | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/config/squid3/34/squid.inc b/config/squid3/34/squid.inc index 15854317..cbb24a04 100755 --- a/config/squid3/34/squid.inc +++ b/config/squid3/34/squid.inc @@ -260,7 +260,7 @@ function squid_dash_z($cache_action = 'none') { return; } - // Re-create the cachedir if clean is forced by cronjob/manually, + // Re-create the cachedir if clean is forced by manually, // or if the cachedir changed, or level1_subdirs don't exist or the number of level1_subdirs changed if ($cache_action == "clean" || !is_dir($cachedir) || !is_dir($cachedir . '/00') || $numdirs != $currentdirs) { // cannot nuke disk cache while Squid is running @@ -319,32 +319,15 @@ function squid_create_cachedir() { /* Handle cronjob install/uninstall */ function squid_install_cron($should_install) { - global $config; - if (platform_booting()) { return; } - parse_config(true); - if (is_array($config['installedpackages']['squidcache'])) { - $settings = $config['installedpackages']['squidcache']['config'][0]; - } else { - $settings = array(); - } - - $cron_cmd = ($settings['clear_cache'] == 'on' ? "/usr/local/pkg/swapstate_check.php clean; " : ""); - $cron_cmd .= SQUID_BASE . "/sbin/squid -k rotate -f " . SQUID_CONFFILE; - install_cron_job("{$cron_cmd}", $should_install, "0", "0", "*", "*", "*", "root"); - - $swapstate_cmd = "/usr/local/pkg/swapstate_check.php clean; "; + $cron_cmd = SQUID_BASE . "/sbin/squid -k rotate -f " . SQUID_CONFFILE; if (($should_install) && (squid_enabled())) { - if ($settings['clear_cache'] == 'on' ) { - install_cron_job("{$swapstate_cmd}", true, "*/360"); - } else { - install_cron_job("{$swapstate_cmd}", false); - } + install_cron_job("{$cron_cmd}", $should_install, "0", "0", "*", "*", "*", "root"); } else { - install_cron_job("{$swapstate_cmd}", false); + install_cron_job("{$cron_cmd}", false); } } @@ -507,6 +490,9 @@ function squid_install_command() { // remove unwanted PBI rc script unlink_if_exists("/usr/local/etc/rc.d/squid"); + // remove broken cronjob possibly left over after 'Clear Cache on Log Rotate' misfeature + install_cron_job("/usr/local/pkg/swapstate_check.php clean;", false); + } function squid_deinstall_command() { |