mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-25 07:00:13 +01:00
fixed the df output processing
This commit is contained in:
parent
7b3f927e18
commit
027fc26a2d
@ -79,6 +79,7 @@ class ModelHealthHealth extends Model {
|
||||
|
||||
public function diskinfo() {
|
||||
$shortinfo = array();
|
||||
$a = array();
|
||||
|
||||
$s = exec("df", $output);
|
||||
|
||||
@ -87,7 +88,9 @@ class ModelHealthHealth extends Model {
|
||||
while(list($k, $v) = each($output)) {
|
||||
if($k > 0) {
|
||||
$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(
|
||||
'partition' => $p[5],
|
||||
'freespace' => $p[3],
|
||||
|
Loading…
Reference in New Issue
Block a user