Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- ###
- # 2014-03-13 by Scott Arciszewski
- # Network down? Use this to benchmark packet loss and ping duration.
- # Prints colorful bash output
- ###
- # You can change these
- HOST="8.8.4.4"
- NUM=128
- # Script actually runs below
- mkdir -p /tmp/pingreport
- FILE=`date | md5sum | cut -f1 -d " "`
- FILE="/tmp/pingreport/$FILE.tmp"
- echo -e "\e[1;34mPinging $HOST with $NUM packets...\e[00m"
- date > $FILE
- ping -c $NUM $HOST >> $FILE
- date >> $FILE
- # echo
- echo -e -n "\tBegin: \e[1;33m"
- head -n 1 $FILE
- echo -e -n "\e[00m\t End: \e[1;33m"
- tail -n 1 $FILE
- echo -e -n "\e[00m"
- tail -n 4 $FILE | head -n 2
- echo -n -e "Report details: \e[1;35m"
- echo $FILE
- echo -e "\e[00m"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement