added timeout
This commit is contained in:
@@ -33,7 +33,7 @@ type WaybarOut struct {
|
||||
}
|
||||
|
||||
func formatLine(stats *probing.Statistics) {
|
||||
if stats.PacketLoss >= 100.0 {
|
||||
if stats.PacketLoss >= 100.0 || stats.PacketsRecv == 0 {
|
||||
// fontawesome/forkawesome doesn't have the fitting icon...
|
||||
// so this is the utf-8 icon/emoji
|
||||
fmt.Printf("%%{F#%s}🚫\n", CritColor)
|
||||
@@ -91,6 +91,7 @@ func main() {
|
||||
goto sleep
|
||||
}
|
||||
pinger.Count = *PingCount
|
||||
pinger.Timeout = 3 * time.Second
|
||||
if *Waybar {
|
||||
pinger.OnFinish = formatLineWaybar
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user