CentOS 7 Installer (#71)

This commit is contained in:
Adam Niedzwiedzki
2017-02-24 03:53:37 +11:00
committed by FusionPBX
parent fbdca20dee
commit e1e6e06162
29 changed files with 1206 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
#!/bin/sh
#move to script directory so all relative paths work
cd "$(dirname "$0")"
. ./colors.sh
. ./arguments.sh
verbose "Installing Fail2ban"
#initialize variable encase we are called directly
#[ -z $USE_FREESWITCH_SOURCE ] && USE_FREESWITCH_SOURCE=false
#add the dependencies
yum -y install fail2ban
#move the filters
cp ./fail2ban/freeswitch-dos.conf /etc/fail2ban/filter.d/freeswitch-dos.conf
cp ./fail2ban/freeswitch-ip.conf /etc/fail2ban/filter.d/freeswitch-ip.conf
cp ./fail2ban/freeswitch-404.conf /etc/fail2ban/filter.d/freeswitch-404.conf
cp ./fail2ban/freeswitch.conf /etc/fail2ban/filter.d/freeswitch.conf
cp ./fail2ban/fusionpbx.conf /etc/fail2ban/filter.d/fusionpbx.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
#update config if source is being used
#if [ $USE_FREESWITCH_SOURCE = true ]; then
# sed 's#var/log/freeswitch#usr/local/freeswitch/log#g' -i /etc/fail2ban/jail.local
#fi
systemctl restart fail2ban
verbose "Fail2ban installed"