Skip to content

Instantly share code, notes, and snippets.

@sasha42
Created January 10, 2017 01:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sasha42/26f2115989ccef4f94a7028ae81b59c6 to your computer and use it in GitHub Desktop.
Save sasha42/26f2115989ccef4f94a7028ae81b59c6 to your computer and use it in GitHub Desktop.
#!/bin/bash
# saves date and average of 4 pings to 8.8.8.8 into log file
count=$(ping -c 4 8.8.8.8 | tail -1 | awk '{print $4}' | cut -d '/' -f 2)
echo "$(date) $count" > pingresponselog.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment