Created
September 16, 2019 13:53
-
-
Save rbreaves/ebf7d7982691de3d0be7dd76bfb1959c to your computer and use it in GitHub Desktop.
Ping Latency with Color
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
# Add to .zshrc or .bashrc | |
alias pg=pingout | |
pingout(){ | |
ping 8.8.8.8 | awk -F" |=" '/time/{if($10>0 && $10<=70){printf "\033[1;32m%i\n\033[0m", $10}; if($10>70 && $10<=99){printf "\033[33m%i\n\033[0m", $10};if($10>99){printf "\033[31m%i\n\033[0m", $10 }}' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment