Created
June 1, 2018 13:52
-
-
Save wikrie/60c3be8edcc300032bea50a15dd46a9c to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
## all Fail2Ban Log should be logged into /var/log/fail2ban.log then this will work | |
## you need geoiplookup to get it runningyou can install it with sudo apt install geoip-bin | |
cat /var/log/fail2ban.log* | grep Ban | sed 's/.*[Bb]an \(.*\)/\1/' | uniq | while read line; do geoiplookup $line; done | sort | uniq -c | sort -nr |
needs geoiplookup
sudo apt-get install geoip-bin
I already point to that with my 2nd comment, I do not see a reason to tell it once more
Check out line 3
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
needs geoiplookup
sudo apt-get install geoip-bin