Skip to content

Instantly share code, notes, and snippets.

@yelizariev
Last active Feb 16, 2019
Embed
What would you like to do?
monitoring tools
sudo apt install lolcat cowsay
while true; do export PINGHOST=8.8.8.8 && RESULT=$(ping -q -n -c 4 $PINGHOST | awk '/packet loss/ {if ($6 != "0%") print $6, "packet loss"}') && echo "Done:" && if [[ -z $RESULT ]]; then cowsay "No package lost!" | lolcat --seed=45; else cowsay $RESULT | lolcat --seed=17; fi; date; echo -n "sleeping... "; sleep 5; echo -n "pinging... "; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment