Skip to content

Instantly share code, notes, and snippets.

@yelizariev
Last active February 16, 2019 22:32
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 yelizariev/0ea45bed982bb68d1568d587b83ba590 to your computer and use it in GitHub Desktop.
Save yelizariev/0ea45bed982bb68d1568d587b83ba590 to your computer and use it in GitHub Desktop.
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