Skip to content

Instantly share code, notes, and snippets.

@sidd607
Created April 4, 2015 05:33
Show Gist options
  • Select an option

  • Save sidd607/eb5ec7226c5c2ad8ae02 to your computer and use it in GitHub Desktop.

Select an option

Save sidd607/eb5ec7226c5c2ad8ae02 to your computer and use it in GitHub Desktop.
echo "TEST-1 Google"
foo=$(ping -c 100 google.com | grep rtt)
echo "FOO: $foo"
echo $foo | awk -F' = ' '{print $2}' | awk -F'/' '{print "RTT Stats: \nMin: " $1 "\nAverage: " $2 "\nMaximum: " $3 "\nMdev: "$4}'
echo "RESULT : Poor Internet" &
avg=$(echo $foo | awk -F' = ' '{print $2}' | awk -F'/' '{print $2}')
echo "AVG: $avg"
result=50
var=$(awk 'BEGIN{ print "'$avg'"<"'$result'" }')
if [ $var -ne 1 ];then
echo "Poor Connections"
else
echo "Good to Go"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment