From 487bde2e929cfbea0f6639b1b91598e857852244 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sun, 23 Apr 2017 01:03:34 -0600 Subject: [PATCH] Update fail2ban.sh --- centos/resources/fail2ban.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/centos/resources/fail2ban.sh b/centos/resources/fail2ban.sh index 1e555a5..952af2e 100755 --- a/centos/resources/fail2ban.sh +++ b/centos/resources/fail2ban.sh @@ -3,12 +3,13 @@ #move to script directory so all relative paths work cd "$(dirname "$0")" +#includes +. ./config.sh . ./colors.sh . ./arguments.sh +#send a message 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 @@ -24,10 +25,12 @@ 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 +if [ .$switch_source = .true ]; then + sed 's#var/log/freeswitch#usr/local/freeswitch/log#g' -i /etc/fail2ban/jail.local +fi +#restart fail2ban systemctl restart fail2ban +#send a message verbose "Fail2ban installed"