修复在linux上挂载点获取结果后有多余\n的问题

This commit is contained in:
Chenx221 2024-04-13 17:08:58 +08:00
parent 54459f0472
commit aa983f379a
Signed by: chenx221
GPG Key ID: D7A9EC07024C3021

View File

@ -304,7 +304,7 @@ class SystemInfoHelper
} }
$this->mp_used = $this->mp_size - $this->mp_avail; $this->mp_used = $this->mp_size - $this->mp_avail;
} else { } else {
$this->dataMountPoint = shell_exec("df -P \"" . $dataPath . "\" | awk 'NR==2{print $6}'"); $this->dataMountPoint = trim(shell_exec("df -P \"" . $dataPath . "\" | awk 'NR==2{print $6}'"));
$this->mp_fs = shell_exec("df -T \"" . $this->dataMountPoint . "\" | awk 'NR==2{print $2}'"); $this->mp_fs = shell_exec("df -T \"" . $this->dataMountPoint . "\" | awk 'NR==2{print $2}'");
$this->mp_size = intval(shell_exec('df -k "' . $this->dataMountPoint . '" | awk \'NR==2{print $2}\'')); $this->mp_size = intval(shell_exec('df -k "' . $this->dataMountPoint . '" | awk \'NR==2{print $2}\''));
$this->mp_used = intval(shell_exec('df -k "' . $this->dataMountPoint . '" | awk \'NR==2{print $3}\'')); $this->mp_used = intval(shell_exec('df -k "' . $this->dataMountPoint . '" | awk \'NR==2{print $3}\''));