From d343974b2f04ac455099b0e0fdf69f687c670ac1 Mon Sep 17 00:00:00 2001 From: jim-p Date: Tue, 13 Aug 2013 16:03:29 -0400 Subject: If the file doens't exist, bail, or this will generate a PHP error. --- config/squid/swapstate_check.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'config') 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); -- cgit v1.2.3