Cleaned up comments

master
parent a73df10f84
commit 3e042e19f9

@ -12,8 +12,6 @@ $dns=$ARGV[0];
my $regex="";
if ($^O == "linux") {
#$regex='([0-9]+ bytes) from ([a-z\.-]+) \(([0-9\.]+)\).*seq=([0-9]+).*time=([0-9\. ms]+)'
#$regex='(?<bytes>[0-9]+ bytes) from (?<rhost>[a-z\.-]+) \((?<rip>[0-9\.]+)\).*seq=(?<rseq>[0-9]+).*time=(?<rms>[0-9\. ms]+)';
$regex=qr/(?<bytes>[0-9]+ bytes) from (?<rhost>[a-z\.-]+) \((?<rip>[0-9\.]+)\).*seq=(?<rseq>[0-9]+).*time=(?<rms>[0-9\.]+) ms/;
$dedjex=qr/no answer yet for icmp_seq=(?<rseq>[0-9]+)/
} elsif ($^O == "MSWin32") {
@ -24,8 +22,6 @@ open(my $PING, "ping -O $dns|") or die "Cannot execute $!";
while (my $line = <$PING>) {
if ($line =~ $regex) {
#print "$4 - $5 - $2 ($3)\n";
#print "$+{rseq} - $+{rms} - $+{rhost} ($+{rip})\n";
if ($+{rms} > 100) {print color("bright_red");}
elsif ($+{rms} > 50) {print color("bright_yellow");}
printf "% 3s - % 4s ms - %s (%s)\n", $+{rseq}, $+{rms}, $+{rhost}, $+{rip};

Loading…
Cancel
Save