Results 1 to 2 of 2

Thread: Shell script for geoiplookup cmd

Hybrid View

  1. #1
    Associate
    Join Date
    Jun 2010
    Location
    Coimbatore
    Posts
    22

    Shell script for geoiplookup cmd

    Hi All,
    I ve the following Script which is used to Block the refused connect IP's......
    `cat /var/log/secure | grep "refused connect" |awk '{print $9}'|sed 's/::ffff://g'|uniq -c | sort -nr |head -8 | awk '{print $2}' >/root/BlockedIP`
    for IP in `cat /root/BlockedIP`;
    do
    iptables -A INPUT -s $IP -j DROP
    done
    This code show only IP's in BlockedIP file.
    In this script i need to add "geoiplookup".
    what i want mean i wannna to show the country name in BlockedIP file.
    How to use the geoiplookup command...?
    Plz any one guid me to complete the script.


    Thanks,
    Hariharan V

  2. #2
    Hi Hari,

    Which place in coimbatore? Where you work in coimbatore?

    Install the geoip utility. then run the command as

    geoiplookup <IPAddress>
    you will find the country name

Similar Threads

  1. Need of shell script
    By Hariharan in forum Linux - Software, Applications & Programming
    Replies: 3
    Last Post: 09-16-2010, 02:34 PM
  2. Shell script for monitoring
    By Hariharan in forum Linux - Software, Applications & Programming
    Replies: 0
    Last Post: 09-16-2010, 05:54 AM
  3. Shell script input and name completion?
    By vwgtiturbo in forum Programming
    Replies: 6
    Last Post: 06-21-2006, 09:27 PM
  4. Dummy shell script question
    By elovkoff in forum Programming
    Replies: 7
    Last Post: 03-19-2003, 03:15 PM
  5. how to make a shortcut for a shell script?
    By S_D_Willie in forum Linux - General Topics
    Replies: 6
    Last Post: 02-06-2002, 12:33 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •