Skip to content

Instantly share code, notes, and snippets.

@andrei0x309
Forked from kamermans/fail2ban-allstatus.sh
Last active December 6, 2016 11:15
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 andrei0x309/6350059357bd455dfdfb6e32d2e9c342 to your computer and use it in GitHub Desktop.
Save andrei0x309/6350059357bd455dfdfb6e32d2e9c342 to your computer and use it in GitHub Desktop.
Show status of all fail2ban jails at once
#!/bin/bash
JAILS=`fail2ban-client status | grep "Jail list" | sed -r 's/^[^:]+:[ \t]+//' | sed 's/,//g'`
for JAIL in $JAILS
do
fail2ban-client status $JAIL
done
@andrei0x309
Copy link
Author

I just switch the option -E to -r in case the version of sed in use does not support E option( for example an old Centos Distro)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment