Skip to content

Instantly share code, notes, and snippets.

@daggerhashimoto
Forked from jameshartig/fail2unban.sh
Created December 2, 2015 20:54
Show Gist options
  • Save daggerhashimoto/c3eb480623747ebf84ed to your computer and use it in GitHub Desktop.
Save daggerhashimoto/c3eb480623747ebf84ed to your computer and use it in GitHub Desktop.
fail2unban
function fail2unban() { for j in $(fail2ban-client status | grep "list:" | tr "\t" "\n" | sed -n 2p | tr -d "[:space:]" | tr "," "\n"); do fail2ban-client set $j unbanip $1; done;}
[root@ike ~]# fail2unban 127.0.0.1
ERROR NOK: ('IP 127.0.0.1 is not banned',)
IP 127.0.0.1 is not banned
ERROR NOK: ('IP 127.0.0.1 is not banned',)
IP 127.0.0.1 is not banned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment