diff options
Diffstat (limited to 'libs/swap.php')
| -rw-r--r-- | libs/swap.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/swap.php b/libs/swap.php index 522660b..e3cc980 100644 --- a/libs/swap.php +++ b/libs/swap.php @@ -1,5 +1,5 @@ <?php -require 'Utils/Misc.class.php'; +require '../autoload.php'; // Free if (!($free = shell_exec('grep SwapFree /proc/meminfo | awk \'{print $2}\''))) @@ -17,7 +17,9 @@ if (!($total = shell_exec('grep SwapTotal /proc/meminfo | awk \'{print $2}\''))) $used = $total - $free; // Percent used -$percent_used = 100 - (round($free / $total * 100)); +$percent_used = 0; +if ($total > 0) + $percent_used = 100 - (round($free / $total * 100)); $datas = array( |
