Created
April 4, 2015 05:33
-
-
Save sidd607/eb5ec7226c5c2ad8ae02 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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