Created
January 3, 2014 05:21
-
-
Save Red5d/8233212 to your computer and use it in GitHub Desktop.
Use this to look up the Country, State, City, ISP, and Hostname of an IP address (given as parameter) from infosniper.net.
Usage: ./iplookup <ip address>
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 | |
info=$(curl -s http://www.infosniper.net/?ip_address=$1 | grep content-td2 | cut -d'>' -f2 | cut -d'<' -f1 | sed 's/ //g') | |
echo -n "Country: " | |
echo "$info" | sed -n '10p' | |
echo -n "State: " | |
echo "$info" | sed -n '6p' | |
echo -n "City: " | |
echo "$info" | sed -n '2p' | |
echo -n "Provider: " | |
echo "$info" | sed -n '5p' | |
echo -n "Hostname: " | |
echo "$info" | sed -n '9p' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment