fixed the df output processing

This commit is contained in:
SJ 2013-08-20 12:05:38 +02:00
parent 7b3f927e18
commit 027fc26a2d

View File

@ -79,6 +79,7 @@ class ModelHealthHealth extends Model {
public function diskinfo() { public function diskinfo() {
$shortinfo = array(); $shortinfo = array();
$a = array();
$s = exec("df", $output); $s = exec("df", $output);
@ -87,7 +88,9 @@ class ModelHealthHealth extends Model {
while(list($k, $v) = each($output)) { while(list($k, $v) = each($output)) {
if($k > 0) { if($k > 0) {
$p = preg_split("/\ {1,}/", $v); $p = preg_split("/\ {1,}/", $v);
if(isset($p[5]) && in_array($p[5], $partitions)) { if(isset($p[5]) && in_array($p[5], $partitions) && !isset($a[$p[5]])) {
$a[$p[5]] = 1;
$shortinfo[] = array( $shortinfo[] = array(
'partition' => $p[5], 'partition' => $p[5],
'freespace' => $p[3], 'freespace' => $p[3],