fail2ban.sh 636 B

12345678910111213141516171819202122232425
  1. #!/bin/sh
  2. # TODO check if root
  3. echo '\033[35m
  4. ______ _ _____ __
  5. / ____/___ _(_) /__ \ / /_ ____ _____
  6. / /_ / __ `/ / /__/ // __ \/ __ `/ __ \
  7. / __/ / /_/ / / // __// /_/ / /_/ / / / /
  8. /_/ \__,_/_/_//____/_.___/\__,_/_/ /_/
  9. \033[0m'
  10. echo "\033[35;1mInstalling fall2ban \033[0m"
  11. if [ "$EUID" -ne 0 ]; then
  12. echo "Please run as root"
  13. exit
  14. fi
  15. sleep 2
  16. apt-get --yes --force-yes install fail2ban
  17. cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
  18. # ToDo ask for email and configure jail.local with it
  19. systemctl enable fail2ban
  20. systemctl restart fail2ban
  21. echo "\033[92;1mfail2ban installed and configured\033[Om"