Advertisement
voodooKobra

Quick ping report

Mar 13th, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.67 KB | None | 0 0
  1. #!/bin/bash
  2. ###
  3. # 2014-03-13 by Scott Arciszewski
  4. # Network down? Use this to benchmark packet loss and ping duration.
  5. # Prints colorful bash output
  6. ###
  7. # You can change these
  8. HOST="8.8.4.4"
  9. NUM=128
  10. # Script actually runs below
  11. mkdir -p /tmp/pingreport
  12. FILE=`date | md5sum | cut -f1 -d " "`
  13. FILE="/tmp/pingreport/$FILE.tmp"
  14. echo -e "\e[1;34mPinging $HOST with $NUM packets...\e[00m"
  15.  
  16. date > $FILE
  17. ping -c $NUM $HOST >> $FILE
  18. date >> $FILE
  19. # echo
  20. echo -e -n "\tBegin: \e[1;33m"
  21. head -n 1 $FILE
  22. echo -e -n "\e[00m\t  End: \e[1;33m"
  23. tail -n 1 $FILE
  24. echo -e -n "\e[00m"
  25. tail -n 4 $FILE | head -n 2
  26. echo -n -e "Report details: \e[1;35m"
  27. echo $FILE
  28. echo -e "\e[00m"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement