#!/bin/bash | |
JAILS=`fail2ban-client status | grep "Jail list" | sed -E 's/^[^:]+:[ \t]+//' | sed 's/,//g'` | |
for JAIL in $JAILS | |
do | |
fail2ban-client status $JAIL | |
done |
Excellent! It was -e for me on Centos 6.
Great!
On a SLES box I had to use lowercase -e as well, and escape the +
signs in the regex
JAILS=`fail2ban-client status | grep "Jail list" | sed -e 's/^[^:]\+:[ \t]\+//' | sed 's/,//g'`
Thank you! It works on Ubuntu 16.04.
Thank you! Also confirming works on Ubuntu 16.04
This is perfect
Built a bash function around it.
It has been said already, but many thanks (Ubuntu 16.04)! :)
Thanks so much
Why make it easy if you can do hard? :-)
fail2ban-client status|awk -F: '/Jail list:/ { split($2,jail,",") ; for (i in jail) { gsub(/[\t ]/,"",jail[i]); system("fail2ban-client status "jail[i]); }; }'
Shorter version:
fail2ban-client status | sed -n 's/,//g;s/.*Jail list://p' | xargs -n1 fail2ban-client status
Nice! Will use this script in my server, ty again <3
Thanks, works well on CentOS 7.
Nice. Needs sudo, so sudo sh -c "fail2ban-client status | sed -n 's/,//g;s/.*Jail list://p' | xargs -n1 fail2ban-client status"
1# sudo apt-get remove fail2ban : remove the packet
2# sudo rm -rf fail2ban : delete fail2ban folder
3# re install again
doesn't ipset list do this?
@stefan1959 I don't know, although this post was over 5 years ago, so things have probably changed!
Thx
thank you
Thank you!
Thank you pal!
Thanks man!
Very handy, thank you
thanks!
Thanks !
thx!
Verify Github on Galxe. gid:hqaGx3KAt8heyLH9WYEKkm
Ta very much!
Thanks! can't believe there isn't a
fail2ban-client status --all
command!