mirror of
https://github.com/nxtrace/NTrace-core.git
synced 2025-08-12 06:26:39 +00:00
add: 添加sudo提示
This commit is contained in:
17
main.go
17
main.go
@@ -34,9 +34,14 @@ func main() {
|
||||
Port: *port,
|
||||
Timeout: time.Second / 2,
|
||||
})
|
||||
res, _ := tcpTraceroute.Start()
|
||||
res, err := tcpTraceroute.Start()
|
||||
|
||||
if err != nil {
|
||||
fmt.Println("请赋予 sudo (root) 权限运行本程序")
|
||||
} else {
|
||||
printer.TraceroutePrinter(ip, *res, *dataOrigin)
|
||||
}
|
||||
|
||||
printer.TraceroutePrinter(ip, *res, *dataOrigin)
|
||||
} else {
|
||||
if *port == 80 {
|
||||
*port = 53
|
||||
@@ -48,9 +53,13 @@ func main() {
|
||||
Port: *port,
|
||||
Timeout: 2 * time.Second,
|
||||
})
|
||||
res, _ := udpTraceroute.Start()
|
||||
res, err := udpTraceroute.Start()
|
||||
|
||||
printer.TraceroutePrinter(ip, *res, *dataOrigin)
|
||||
if err != nil {
|
||||
fmt.Println("请赋予 sudo (root) 权限运行本程序")
|
||||
} else {
|
||||
printer.TraceroutePrinter(ip, *res, *dataOrigin)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user