#!/bin/bash
usage () {
echo "usage: geoip <IP-address>"
}
ip_regexp=^[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}$
if [[ $1 =~ $ip_regexp ]]; then
links -dump "http://www.geoiptool.com/en/?IP=$1" | grep -v "IMG" | head -n -1 | tail -n +9 | sed -e 's/[|]//g;s/+-*+//'
elif [[ $1 != $ip_regexp ]]; then
echo "Specify valid IP address"
fi
Simple location check using geoip tool
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment