mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-25 19:00:12 +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() {
|
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],
|
||||||
|
Loading…
Reference in New Issue
Block a user