Skip to content

Instantly share code, notes, and snippets.

@jeffgeiger
Last active July 20, 2016 13:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffgeiger/56141584a2c66451d334 to your computer and use it in GitHub Desktop.
Save jeffgeiger/56141584a2c66451d334 to your computer and use it in GitHub Desktop.
Simple visual ping check
ping_check() { while :; do PINGRESULT=$(ping -c1 $1 | grep "bytes from"); if [[ $? -eq 0 ]]; then RTT=$(echo $PINGRESULT | awk -F= '{print $NF}'); echo "👍 $RTT"; else echo "💩 NO CONNECTION"; fi; sleep 5; done; }
@jeffgeiger
Copy link
Author

Usage: ping_check 8.8.8.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment