aboutsummaryrefslogtreecommitdiffstats
path: root/config/squid3/33
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2014-11-06 08:13:59 -0500
committerjim-p <jimp@pfsense.org>2014-11-06 08:13:59 -0500
commit86a5ead2aa506d5ff67a1f7727be367d12dbbb92 (patch)
tree8b8f40ed65ac44893cad87b16201004bddb7d34e /config/squid3/33
parent8fcc2a00607cf9e2f86b5bd109d98be1fd463b05 (diff)
parent4f282a597ab24f0fbc6abc6dab2e8b9386f7811b (diff)
downloadpfsense-packages-86a5ead2aa506d5ff67a1f7727be367d12dbbb92.tar.gz
pfsense-packages-86a5ead2aa506d5ff67a1f7727be367d12dbbb92.tar.bz2
pfsense-packages-86a5ead2aa506d5ff67a1f7727be367d12dbbb92.zip
Merge pull request #724 from phil-davis/patch-1
Diffstat (limited to 'config/squid3/33')
-rw-r--r--config/squid3/33/swapstate_check.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/config/squid3/33/swapstate_check.php b/config/squid3/33/swapstate_check.php
index a0b3c98b..616b8fd9 100644
--- a/config/squid3/33/swapstate_check.php
+++ b/config/squid3/33/swapstate_check.php
@@ -42,6 +42,8 @@ else
if ($settings['harddisk_cache_system'] != "null"){
$cachedir =($settings['harddisk_cache_location'] ? $settings['harddisk_cache_location'] : '/var/squid/cache');
$swapstate = $cachedir . '/swap.state';
+ if (!file_exists($swapstate))
+ return;
$disktotal = disk_total_space(dirname($cachedir));
$diskfree = disk_free_space(dirname($cachedir));
$diskusedpct = round((($disktotal - $diskfree) / $disktotal) * 100);
@@ -55,4 +57,4 @@ if ($settings['harddisk_cache_system'] != "null"){
log_error(gettext(sprintf("Squid cache and/or swap.state exceeded size limits. Removing and rotating. File was %d bytes, %d%% of total disk space.", $swapstate_size, $swapstate_pct)));
}
}
-?> \ No newline at end of file
+?>