forked from norman/fusionpbx-install.sh-github-mirror
Update fail2ban.sh
This commit is contained in:
@@ -3,12 +3,13 @@
|
|||||||
#move to script directory so all relative paths work
|
#move to script directory so all relative paths work
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
#includes
|
||||||
|
. ./config.sh
|
||||||
. ./colors.sh
|
. ./colors.sh
|
||||||
. ./arguments.sh
|
. ./arguments.sh
|
||||||
|
|
||||||
|
#send a message
|
||||||
verbose "Installing Fail2ban"
|
verbose "Installing Fail2ban"
|
||||||
#initialize variable encase we are called directly
|
|
||||||
#[ -z $USE_FREESWITCH_SOURCE ] && USE_FREESWITCH_SOURCE=false
|
|
||||||
|
|
||||||
#add the dependencies
|
#add the dependencies
|
||||||
yum -y install fail2ban
|
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
|
cp ./fail2ban/jail.local /etc/fail2ban/jail.local
|
||||||
|
|
||||||
#update config if source is being used
|
#update config if source is being used
|
||||||
#if [ .$USE_FREESWITCH_SOURCE = .true ]; then
|
if [ .$switch_source = .true ]; then
|
||||||
# sed 's#var/log/freeswitch#usr/local/freeswitch/log#g' -i /etc/fail2ban/jail.local
|
sed 's#var/log/freeswitch#usr/local/freeswitch/log#g' -i /etc/fail2ban/jail.local
|
||||||
#fi
|
fi
|
||||||
|
|
||||||
|
#restart fail2ban
|
||||||
systemctl restart fail2ban
|
systemctl restart fail2ban
|
||||||
|
|
||||||
|
#send a message
|
||||||
verbose "Fail2ban installed"
|
verbose "Fail2ban installed"
|
||||||
|
|||||||
Reference in New Issue
Block a user