diff options
author | Daniel Friesel <derf@finalrewind.org> | 2011-06-15 22:15:19 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-06-15 22:15:19 +0200 |
commit | b4190f07a8a91ede950fa890a8352ebf70bbf637 (patch) | |
tree | a626f8441cd370183c083f136668c85e453864a2 /bin/ekgping | |
parent | fecf23a44f31d149fe7310a9e3c50c11896a54de (diff) |
Don't crash if ping fails
Diffstat (limited to 'bin/ekgping')
-rwxr-xr-x | bin/ekgping | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/ekgping b/bin/ekgping index f3e1631..a7dffd1 100755 --- a/bin/ekgping +++ b/bin/ekgping @@ -92,7 +92,12 @@ print "\e[?25l"; while ( usleep(100_000) ) { - $ping->pump_nb(); + if ($ping->pumpable()) { + $ping->pump_nb(); + } + elsif (($dead_count % 10) == 0) + $ping->start(); + } $column++; @@ -220,8 +225,6 @@ B<ekgping> parses the output of ping(1), which means it assumes a certain output style. It will only work with ping(1) programs whose C<< ping -n >> output matches "<digit> bytes from <ip>: icmp_req=<digit> ttl=<digit> time=<float>". -If a host is unreachable from the very beginning, B<ekgping> fails to start. - =head1 AUTHOR Copyright (C) 2011 by Daniel Friesel E<lt>derf@finalrewind.orgE<gt> |