diff options
| author | Nicolas LLOBERA <nllobera@gmail.com> | 2017-03-20 15:37:19 +0100 |
|---|---|---|
| committer | Nicolas LLOBERA <nllobera@gmail.com> | 2017-03-20 15:37:19 +0100 |
| commit | 1fc75db4b55ba2169e34cb275be1956fc578b1b4 (patch) | |
| tree | d84feea058967d5e4980bd4d2cbb93a1f16d0913 /libs/disk.php | |
| parent | 859f243fa2f3f8d305c00a3096eda4e1fb9082a0 (diff) | |
| parent | 7ed8e89bfb400e0e26db5be9982e4a7aa4aed3c2 (diff) | |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'libs/disk.php')
| -rw-r--r-- | libs/disk.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/disk.php b/libs/disk.php index 8760816..80fedc7 100644 --- a/libs/disk.php +++ b/libs/disk.php @@ -4,7 +4,7 @@ $Config = new Config(); $datas = array(); -if (!(exec('/bin/df -T -P | awk -v c=`/bin/df -T | grep -bo "Type" | awk -F: \'{print $2}\'` \'{print substr($0,c);}\' | tail -n +2 | awk \'{print $1","$2","$3","$4","$5","$6","$7}\'', $df))) +if (!(exec('/bin/df -T -P | sed -e \'s/[ \t]//\' | awk -v c=`/bin/df -T | grep -bo "Type" | awk -F: \'{print $2}\'` \'{print substr($0,c);}\' | tail -n +2 | awk \'{print $1","$2","$3","$4","$5","$6","$7}\'', $df))) { $datas[] = array( 'total' => 'N.A', @@ -24,6 +24,9 @@ else { list($filesystem, $type, $total, $used, $free, $percent, $mount) = explode(',', $mounted); + if ($percent > 100) + $percent = 100; + if (strpos($type, 'tmpfs') !== false && $Config->get('disk:show_tmpfs') === false) continue; |
