Files
fusionpbx-install.sh/centos/resources/fail2ban.sh
erxspin 5a2f3521cb Bug fix exec permissions CentOS - part 1 (#89)
* added CentOS, Fedora, RHEL choices with minimal version check (recommited)

* fixed small typos

* added special option --use-php5-package

* parse options and export new environment variable USE_PHP5_PACKAGE

* added choice between php5* or php7.0* packages (recommited)

* fixed php*-fpm service name and php.ini file path (recommited)

* prepare socket name for nginx to work with php5-fpm or php7.0-fpm (recommited)

* added ppa:ondrej/php5-compat repo

* added dependency ppa:ondrej/php repo and package software-properties-common

* added execute permissions to ./centos/*.sh files
2017-03-17 17:44:14 -06:00

34 lines
1.1 KiB
Bash
Executable File

#!/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"