mirror of
https://github.com/oneclickvirt/basics.git
synced 2025-10-05 16:48:09 +08:00
update
This commit is contained in:
@@ -50,12 +50,10 @@ func getDiskInfo() (string, string, string, error) {
|
|||||||
cmd := exec.Command("df", "-x", "tmpfs", "/")
|
cmd := exec.Command("df", "-x", "tmpfs", "/")
|
||||||
output, err := cmd.Output()
|
output, err := cmd.Output()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
// 解析输出
|
|
||||||
lines := strings.Split(string(output), "\n")
|
lines := strings.Split(string(output), "\n")
|
||||||
if len(lines) >= 2 {
|
if len(lines) >= 2 {
|
||||||
// 解析第二行的值
|
fields := strings.Split(strings.TrimSpace(lines[1]), " ")
|
||||||
fields := strings.Fields(lines[1])
|
if len(fields) > 0 && fields[0] != "" {
|
||||||
if len(fields) < 6 {
|
|
||||||
bootPath = fields[0]
|
bootPath = fields[0]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user