Skip to content

Instantly share code, notes, and snippets.

@chetbox
Created February 15, 2019 10:46
Show Gist options
  • Save chetbox/0facbcd72c5955dd2ce28d52105b9690 to your computer and use it in GitHub Desktop.
Save chetbox/0facbcd72c5955dd2ce28d52105b9690 to your computer and use it in GitHub Desktop.
# Compare packet loss to two destinations
# Works on macOS
(while true ; do
date
ping -c 1 192.168.1.1
date
ping -c 1 1.1.1.1
sleep 1
done) \
| egrep --line-buffered '(packet loss|GMT|ping statistics)' \
| sed -l 's/% packet loss//' \
| sed -l 's/^1 packet.* //' \
| sed -l 's/--- //' \
| sed -l 's/ ping statistics ---//' \
| paste -d , - - -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment