mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-08-04 18:15:29 +02:00
feat(setup): Add fail2ban
sub-command status <JAIL>
(#3455)
* Added status command to fail2ban setup script * Switched to `printf` for command output Co-authored-by: Casper <casperklein@users.noreply.github.com> * Update docs/content/config/security/fail2ban.md Co-authored-by: Casper <casperklein@users.noreply.github.com> --------- Co-authored-by: Casper <casperklein@users.noreply.github.com>
This commit is contained in:
parent
da984e5696
commit
85603193a2
3 changed files with 14 additions and 0 deletions
|
@ -6,6 +6,7 @@ source /usr/local/bin/helpers/index.sh
|
|||
function __usage() {
|
||||
echo "Usage: ./setup.sh fail2ban [<ban|unban> <IP>]"
|
||||
echo " ./setup.sh fail2ban log"
|
||||
echo " ./setup.sh fail2ban status"
|
||||
}
|
||||
|
||||
fail2ban-client ping &>/dev/null || _exit_with_error "Fail2ban not running"
|
||||
|
@ -72,6 +73,12 @@ else
|
|||
cat /var/log/mail/fail2ban.log
|
||||
;;
|
||||
|
||||
( 'status' )
|
||||
for JAIL in "${JAILS[@]}"; do
|
||||
printf '%s\n\n' "$(fail2ban-client status "${JAIL}" 2>&1)"
|
||||
done
|
||||
;;
|
||||
|
||||
( * )
|
||||
__usage
|
||||
_exit_with_error "Unknown command '${1}'"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue