Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Monitor network, gathering ping and HTTP headers
#!/bin/bash
#
# Name: pingtimer.sh
# Desc: Monitor network, gathering ping and HTTP headers
# URL: https://gist.github.com/lyndell/21d7ada9774784b03da1
#
# Author: Lyndell Rottmann
# WWW: http://Lyndell.US
# Copyright (c) 2015 Lyndell Rottmann
#
# Debug mode on/off: (default off)
set +x
if [ $1 ]; then
TESTIP=${1}
else
TESTIP="www.Lyndell.NET"
fi
function quit ()
{
echo -e "\n*** Exiting by user keystroke ***\n"
exit $?
}
# trap keyboard interrupt (control-c)
trap quit SIGINT
echo -e "\n*** Press ctrol+c to quit. ***\n\n"
while true
do
date
ping -i 20 -c 10 ${TESTIP}
echo ""
traceroute -n -I ${TESTIP}
echo ""
curl -I http://${TESTIP}
echo ""
echo ""
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment