Skip to content

Instantly share code, notes, and snippets.

@jjasghar
Forked from ahmadawais/.zshrc
Created August 19, 2019 20:49
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 jjasghar/9dc8981cc07321e02c0b6857ebcbaf2c to your computer and use it in GitHub Desktop.
Save jjasghar/9dc8981cc07321e02c0b6857ebcbaf2c to your computer and use it in GitHub Desktop.
Print status for all fail2ban jails.
# Print status for all fail2ban jails.
function f2bstall() {
JAILS=($(fail2ban-client status | grep "Jail list" | sed -E 's/^[^:]+:[ \t]+//' | sed 's/,//g'))
for JAIL in ${JAILS[@]}
do
echo "--------------- 👀 JAIL STATUS: $JAIL ... ---------------"
fail2ban-client status $JAIL
echo "--------------- ... ---------------"
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment