mirror of
https://github.com/go-ping/ping.git
synced 2025-07-18 08:01:06 +00:00
Update doc on privileged ping and install
This commit is contained in:
parent
77403bd6ed
commit
3535a0e9a0
16
README.md
16
README.md
@ -43,7 +43,21 @@ It sends ICMP packet(s) and waits for a response. If it receives a response,
|
|||||||
it calls the "receive" callback. When it's finished, it calls the "finish"
|
it calls the "receive" callback. When it's finished, it calls the "finish"
|
||||||
callback.
|
callback.
|
||||||
|
|
||||||
For a full ping example, see "cmd/ping/ping.go".
|
For a full ping example, see
|
||||||
|
[cmd/ping/ping.go"](https://github.com/sparrc/go-ping/blob/master/cmd/ping/ping.go)
|
||||||
|
|
||||||
|
## Installation:
|
||||||
|
|
||||||
|
```
|
||||||
|
go get github.com/sparrc/go-ping
|
||||||
|
```
|
||||||
|
|
||||||
|
To install the native Go ping executable:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
go get github.com/sparrc/go-ping/...
|
||||||
|
$GOPATH/bin/ping
|
||||||
|
```
|
||||||
|
|
||||||
## Note on Linux Support:
|
## Note on Linux Support:
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ import (
|
|||||||
var usage = `
|
var usage = `
|
||||||
Usage:
|
Usage:
|
||||||
|
|
||||||
ping [-c count] [-i interval] [-t timeout] host
|
ping [-c count] [-i interval] [-t timeout] [--privileged] host
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
@ -26,6 +26,9 @@ Examples:
|
|||||||
|
|
||||||
# ping google for 10 seconds
|
# ping google for 10 seconds
|
||||||
ping -t 10s www.google.com
|
ping -t 10s www.google.com
|
||||||
|
|
||||||
|
# Send a privileged raw ICMP ping
|
||||||
|
sudo ping --privileged www.google.com
|
||||||
`
|
`
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
Loading…
Reference in New Issue
Block a user