Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19
Shell script for geoiplookup cmd
Results 1 to 2 of 2

Thread: Shell script for geoiplookup cmd

  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

    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Similar Threads

  1. Shell script coding
    By lab in forum Programming
    Replies: 0
    Last Post: 07-14-2012, 05:18 AM
  2. Shell script coding
    By lab in forum Programming
    Replies: 0
    Last Post: 07-05-2012, 01:49 PM
  3. Need of shell script
    By Hariharan in forum Linux - Software, Applications & Programming
    Replies: 3
    Last Post: 09-16-2010, 02:34 PM
  4. Shell script for monitoring
    By Hariharan in forum Linux - Software, Applications & Programming
    Replies: 0
    Last Post: 09-16-2010, 05:54 AM
  5. Shell script input and name completion?
    By vwgtiturbo in forum Programming
    Replies: 6
    Last Post: 06-21-2006, 09:27 PM

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
  •