Small fixes and log beautification,
parent
e6e6b90201
commit
9cb1141012
|
@ -115,13 +115,14 @@ func isActive(bridgeip string) bool {
|
|||
}
|
||||
// just in case it doesn't stops alone
|
||||
defer pinger.Stop()
|
||||
pinger.Count = 3
|
||||
pinger.Interval = time.Duration(100 * time.Millisecond)
|
||||
pinger.Count = 5
|
||||
pinger.Interval = time.Duration(10 * time.Millisecond)
|
||||
pinger.Timeout = time.Duration(1 * time.Second)
|
||||
pinger.Run() // blocks until finished
|
||||
stats := pinger.Statistics()
|
||||
log.Println("Ping results for: ", bridgeip)
|
||||
log.Printf("%d packet sent, %d packet recv", pinger.Count, stats.PacketsRecv)
|
||||
log.Printf("%d packet sent, %d packet recv\n", pinger.Count, stats.PacketsRecv)
|
||||
log.Println("IsACTIVE: ", stats.PacketsRecv == pinger.Count)
|
||||
|
||||
return stats.PacketsRecv == pinger.Count
|
||||
|
||||
|
|
|
@ -8,5 +8,5 @@
|
|||
"ExistingInterface": "eth0",
|
||||
"BridgeIpCIDR": "10.0.1.1/24"
|
||||
},
|
||||
"debug": false
|
||||
"debug": true
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue