mirror of
https://github.com/nezhahq/nezha.git
synced 2025-01-23 13:18:13 -05:00
1991f0636b
This reverts commit c8a1133332
.
31 lines
591 B
Go
31 lines
591 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
"os/exec"
|
|
|
|
"github.com/shirou/gopsutil/v3/disk"
|
|
)
|
|
|
|
func main() {
|
|
dparts, _ := disk.Partitions(false)
|
|
for _, part := range dparts {
|
|
u, _ := disk.Usage(part.Mountpoint)
|
|
if u != nil {
|
|
log.Printf("%s %d %d", part.Device, u.Total, u.Used)
|
|
}
|
|
}
|
|
}
|
|
|
|
func cmdExec() {
|
|
cmd := exec.Command("ping", "qiongbi.net", "-c2")
|
|
output, err := cmd.Output()
|
|
log.Println("output:", string(output))
|
|
log.Println("err:", err)
|
|
|
|
cmd = exec.Command("ping", "qiongbi", "-c2")
|
|
output, err = cmd.Output()
|
|
log.Println("output:", string(output))
|
|
log.Println("err:", err)
|
|
}
|