Fork of FusionPBX but with LDAP kinda working
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.3 KiB

  1. #!/bin/sh
  2. #move to script directory so all relative paths work
  3. cd "$(dirname "$0")"
  4. #includes
  5. . ./config.sh
  6. . ./colors.sh
  7. . ./environment.sh
  8. #send a message
  9. verbose "Installing Fail2ban"
  10. #add the dependencies
  11. apt-get install -y fail2ban
  12. #move the filters
  13. cp fail2ban/freeswitch.conf /etc/fail2ban/filter.d/freeswitch.conf
  14. cp fail2ban/freeswitch-acl.conf /etc/fail2ban/filter.d/freeswitch-acl.conf
  15. cp fail2ban/sip-auth-failure.conf /etc/fail2ban/filter.d/sip-auth-failure.conf
  16. cp fail2ban/sip-auth-challenge.conf /etc/fail2ban/filter.d/sip-auth-challenge.conf
  17. cp fail2ban/auth-challenge-ip.conf /etc/fail2ban/filter.d/auth-challenge-ip.conf
  18. cp fail2ban/freeswitch-ip.conf /etc/fail2ban/filter.d/freeswitch-ip.conf
  19. cp fail2ban/fusionpbx.conf /etc/fail2ban/filter.d/fusionpbx.conf
  20. cp fail2ban/fusionpbx-mac.conf /etc/fail2ban/filter.d/fusionpbx-mac.conf
  21. cp fail2ban/fusionpbx-404.conf /etc/fail2ban/filter.d/fusionpbx-404.conf
  22. cp fail2ban/nginx-404.conf /etc/fail2ban/filter.d/nginx-404.conf
  23. cp fail2ban/nginx-dos.conf /etc/fail2ban/filter.d/nginx-dos.conf
  24. cp fail2ban/jail.local /etc/fail2ban/jail.local
  25. #update config if source is being used
  26. #if [ .$switch_source = .true ]; then
  27. # sed 's#var/log/freeswitch#usr/local/freeswitch/log#g' -i /etc/fail2ban/jail.local
  28. #fi
  29. #restart fail2ban
  30. /usr/sbin/service fail2ban restart