diff options
author | doktornotor <notordoktor@gmail.com> | 2015-09-30 11:31:47 +0200 |
---|---|---|
committer | doktornotor <notordoktor@gmail.com> | 2015-09-30 11:31:47 +0200 |
commit | d73dc9987b4d75f77246d4821c3704031b8fbc5a (patch) | |
tree | d19fcd9dceaccbd2df331975220a2fa5a3825fb5 /config/squid3/34 | |
parent | 8454383e2a4bb1fba0050b4d8f66ab7cb79c9898 (diff) | |
download | pfsense-packages-d73dc9987b4d75f77246d4821c3704031b8fbc5a.tar.gz pfsense-packages-d73dc9987b4d75f77246d4821c3704031b8fbc5a.tar.bz2 pfsense-packages-d73dc9987b4d75f77246d4821c3704031b8fbc5a.zip |
Fix squid_dash_z() logic so that it creates cache dir properly when it has changed
Diffstat (limited to 'config/squid3/34')
-rwxr-xr-x | config/squid3/34/squid.inc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/config/squid3/34/squid.inc b/config/squid3/34/squid.inc index e44dbe62..0faba446 100755 --- a/config/squid3/34/squid.inc +++ b/config/squid3/34/squid.inc @@ -136,18 +136,18 @@ function squid_dash_z($cache_action = 'none') { return; } - if ($cache_action == "clean" && is_dir($cachedir)) { + if ($cache_action == "clean" || (!is_dir($cachedir))) { // cannot nuke disk cache while Squid is running squid_stop_monitor(); if (is_service_running('squid')) { stop_service("squid"); } - rename($cachedir, "{$cachedir}.old"); - mwexec_bg("/bin/rm -rf {$cachedir}.old"); + if (is_dir($cachedir)) { + rename($cachedir, "{$cachedir}.old"); + mwexec_bg("/bin/rm -rf {$cachedir}.old"); + } squid_create_cachedir(); squid_restart_services(); - } else { - squid_create_cachedir(); } } |