checker: Use OnFinish to perform need tips about firewall
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
11bf5362a3
commit
d61f28875e
2 changed files with 23 additions and 10 deletions
|
|
@ -98,7 +98,7 @@ func has_test(m map[AdlinTest]int, test AdlinTest) bool {
|
|||
|
||||
// ICMP
|
||||
|
||||
func check_ping(ip string, cb func(pkt *ping.Packet)) (err error) {
|
||||
func check_ping(ip string, cb func(pkt *ping.Packet), cb_finished func(stats *ping.Statistics)) (err error) {
|
||||
var pinger *ping.Pinger
|
||||
pinger, err = ping.NewPinger(ip)
|
||||
if err != nil {
|
||||
|
|
@ -112,6 +112,7 @@ func check_ping(ip string, cb func(pkt *ping.Packet)) (err error) {
|
|||
pinger.Timeout = time.Second * 5
|
||||
pinger.Count = 1
|
||||
pinger.OnRecv = cb
|
||||
pinger.OnFinish = cb_finished
|
||||
pinger.SetPrivileged(true)
|
||||
err = pinger.Run()
|
||||
|
||||
|
|
|
|||
Reference in a new issue