aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2013-08-13 16:03:29 -0400
committerjim-p <jimp@pfsense.org>2013-08-13 16:03:29 -0400
commitd343974b2f04ac455099b0e0fdf69f687c670ac1 (patch)
treeea7d74719eb0f5c58428aaf1ccb76e120acd8992 /config
parent3291e0ddd539dd23e3e6c7a700c8db645e3840eb (diff)
downloadpfsense-packages-d343974b2f04ac455099b0e0fdf69f687c670ac1.tar.gz
pfsense-packages-d343974b2f04ac455099b0e0fdf69f687c670ac1.tar.bz2
pfsense-packages-d343974b2f04ac455099b0e0fdf69f687c670ac1.zip
If the file doens't exist, bail, or this will generate a PHP error.
Diffstat (limited to 'config')
-rw-r--r--config/squid/swapstate_check.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/config/squid/swapstate_check.php b/config/squid/swapstate_check.php
index d70c2dd4..77730e33 100644
--- a/config/squid/swapstate_check.php
+++ b/config/squid/swapstate_check.php
@@ -35,6 +35,8 @@ $settings = $config['installedpackages']['squidcache']['config'][0];
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);