mirror of
https://github.com/oneclickvirt/basics.git
synced 2025-10-06 17:17:15 +08:00
update
This commit is contained in:
19
system/tcpcontrol_linux.go
Normal file
19
system/tcpcontrol_linux.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
// getTCPAccelerateStatus 查询TCP控制算法
|
||||
func getTCPAccelerateStatus() string {
|
||||
cmd := exec.Command("sysctl", "-n", "net.ipv4.tcp_congestion_control")
|
||||
var out bytes.Buffer
|
||||
cmd.Stdout = &out
|
||||
err := cmd.Run()
|
||||
if err != nil {
|
||||
return ""
|
||||
} else {
|
||||
return out.String()
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user