Created
February 6, 2012 19:20
-
-
Save error454/1754202 to your computer and use it in GitHub Desktop.
Bash DNS resolution timer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Sleep interval | |
S=$1 | |
#filename suffix | |
suffix="s.log" | |
while(true) | |
do | |
line=`date +"%m-%d-%y %H:%M:%S"` | |
out=`dig somehost.com | grep Query | gawk -F' ' '{print $4}'` | |
filename=dnstiming-`date +"%m-%d-%y"`-$S | |
filename="$filename$suffix" | |
echo $line $out >> $filename | |
sleep $S | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment