Created
March 31, 2025 06:26
-
-
Save ripsnortntear/e1064acde4a061331e96ee4353b87658 to your computer and use it in GitHub Desktop.
This script checks and displays the status of all Fail2Ban jails on the system by iterating through the list of active jails and retrieving their individual statuses.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check the status of all Fail2Ban jails | |
for jail in $(sudo fail2ban-client status | grep 'Jail list:' | cut -d ':' -f 2 | tr -d ' ' | tr ',' ' '); do | |
sudo fail2ban-client status "$jail" | |
echo "" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment