fusionpbx-install.sh/debian/resources/fail2ban.sh

38 lines
1.3 KiB
Bash
Raw Normal View History

2016-04-29 21:24:22 +02:00
#!/bin/sh
2017-01-15 09:15:53 +01:00
#move to script directory so all relative paths work
cd "$(dirname "$0")"
2017-01-15 09:15:53 +01:00
2017-03-04 20:58:08 +01:00
#includes
2017-03-04 20:50:13 +01:00
. ./config.sh
. ./colors.sh
2020-03-29 03:16:57 +02:00
. ./environment.sh
2016-04-29 21:24:22 +02:00
#send a message
verbose "Installing Fail2ban"
2016-04-29 21:24:22 +02:00
#add the dependencies
2024-05-09 16:59:47 +02:00
apt-get install -y fail2ban rsyslog
2016-04-29 21:24:22 +02:00
#move the filters
cp fail2ban/freeswitch.conf /etc/fail2ban/filter.d/freeswitch.conf
cp fail2ban/freeswitch-acl.conf /etc/fail2ban/filter.d/freeswitch-acl.conf
2018-05-02 23:15:13 +02:00
cp fail2ban/sip-auth-failure.conf /etc/fail2ban/filter.d/sip-auth-failure.conf
cp fail2ban/sip-auth-challenge.conf /etc/fail2ban/filter.d/sip-auth-challenge.conf
2018-07-12 02:17:33 +02:00
cp fail2ban/auth-challenge-ip.conf /etc/fail2ban/filter.d/auth-challenge-ip.conf
cp fail2ban/freeswitch-ip.conf /etc/fail2ban/filter.d/freeswitch-ip.conf
cp fail2ban/fusionpbx.conf /etc/fail2ban/filter.d/fusionpbx.conf
2017-10-09 19:35:04 +02:00
cp fail2ban/fusionpbx-mac.conf /etc/fail2ban/filter.d/fusionpbx-mac.conf
2018-01-26 17:54:41 +01:00
cp fail2ban/fusionpbx-404.conf /etc/fail2ban/filter.d/fusionpbx-404.conf
cp fail2ban/nginx-404.conf /etc/fail2ban/filter.d/nginx-404.conf
cp fail2ban/nginx-dos.conf /etc/fail2ban/filter.d/nginx-dos.conf
cp fail2ban/jail.local /etc/fail2ban/jail.local
2016-04-29 21:24:22 +02:00
#update config if source is being used
2019-03-14 16:00:50 +01:00
#if [ .$switch_source = .true ]; then
# sed 's#var/log/freeswitch#usr/local/freeswitch/log#g' -i /etc/fail2ban/jail.local
#fi
2016-04-29 21:24:22 +02:00
#restart fail2ban
2020-10-15 22:59:47 +02:00
/usr/sbin/service fail2ban restart