fix the fix

This commit is contained in:
Marcello Coutinho 2018-06-20 17:13:35 -03:00
parent 57fe270e32
commit 9f20830105
2 changed files with 2 additions and 2 deletions

View File

@ -177,7 +177,7 @@ function disk_usage($slice = '/') {
}
function swap_usage() {
exec("/usr/sbin/swapinfo | /usr/bin/grep Total", $swap_info);
exec("/usr/sbin/swapinfo | /usr/bin/tail -1", $swap_info);
$swap_used = "";
foreach ($swap_info as $line) {
if (preg_match('/(\d+)%$/', $line, $matches)) {

View File

@ -435,7 +435,7 @@ $temp_use_f = (isset($user_settings['widgets']['thermal_sensors-0']) && !empty($
<div class="progress-bar progress-bar-striped" role="progressbar" aria-valuenow="<?=$swapusage?>" aria-valuemin="0" aria-valuemax="100" style="width: <?=$swapusage?>%">
</div>
</div>
<span><?=$swapusage?>% of <?= sprintf("%.0f", `/usr/sbin/swapinfo -m | /usr/bin/grep Total | /usr/bin/awk '{ print $2;}'`) ?> MiB</span>
<span><?=$swapusage?>% of <?= sprintf("%.0f", `/usr/sbin/swapinfo -m | /usr/bin/tail -1 | /usr/bin/awk '{ print $2;}'`) ?> MiB</span>
</td>
</tr>
<?php endif; ?>