Skip to content

Instantly share code, notes, and snippets.

@jeffgeiger
Last active July 20, 2016 13:42
Show Gist options
  • Select an option

  • Save jeffgeiger/56141584a2c66451d334 to your computer and use it in GitHub Desktop.

Select an option

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
Copy Markdown
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