Skip to content

Instantly share code, notes, and snippets.

@ntbrock
Created March 30, 2015 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ntbrock/c6110dd8520a25d75c70 to your computer and use it in GitHub Desktop.
Save ntbrock/c6110dd8520a25d75c70 to your computer and use it in GitHub Desktop.
geoFail2Ban.sh
# cat geoFail2Ban.sh
#!/bin/sh
export TMP_F2B='/tmp/fail2ban.cut'
cat /var/log/fail2ban.log|grep Ban|cut -f 7 -d ' ' > $TMP_F2B
while read p; do
echo -n $p
geoiplookup $p
done <$TMP_F2B
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment