This commit is contained in:
Mark J Crane 2017-03-25 12:40:59 -06:00
commit 675cbe8303
2 changed files with 18 additions and 23 deletions

View File

@ -9,17 +9,14 @@ cd "$(dirname "$0")"
. ./resources/environment.sh
# removes the cd img from the /etc/apt/sources.list file (not needed after base install)
sed -i '/cdrom:/d' /etc/apt/sources.list
#sed -i '/cdrom:/d' /etc/apt/sources.list
#Update to latest packages
verbose "Update installed packages"
apt-get upgrade && apt-get update -y --force-yes
pkg upgrade
#Add dependencies
apt-get install -y lsb-release
#IPTables
resources/iptables.sh
#PF - Packet Filter
resources/pf.sh
#FusionPBX
resources/fusionpbx.sh
@ -31,7 +28,7 @@ resources/nginx.sh
resources/php.sh
#Fail2ban
resources/fail2ban.sh
#resources/fail2ban.sh
#FreeSWITCH
resources/switch.sh
@ -43,7 +40,6 @@ resources/postgres.sh
server_address=$(hostname -I)
#restart services
systemctl daemon-reload
if [ ."$php_version" = ."5" ]; then
systemctl restart php5-fpm
fi

View File

@ -12,17 +12,20 @@ cd "$(dirname "$0")"
verbose "Installing Fail2ban"
#add the dependencies
apt-get install -y --force-yes fail2ban
pkg install --yes py27-fail2ban
#enable fail2ban service
echo 'fail2ban_enable="YES"' >> /etc/rc.conf
#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
cp fail2ban/freeswitch-dos.conf /usr/local/etc/fail2ban/filter.d/freeswitch-dos.conf
cp fail2ban/freeswitch-ip.conf /usr/local/etc/fail2ban/filter.d/freeswitch-ip.conf
cp fail2ban/freeswitch-404.conf /usr/local/etc/fail2ban/filter.d/freeswitch-404.conf
cp fail2ban/freeswitch.conf /usr/local/etc/fail2ban/filter.d/freeswitch.conf
cp fail2ban/fusionpbx.conf /usr/local/etc/fail2ban/filter.d/fusionpbx.conf
cp fail2ban/nginx-404.conf /usr/local/etc/fail2ban/filter.d/nginx-404.conf
cp fail2ban/nginx-dos.conf /usr/local/etc/fail2ban/filter.d/nginx-dos.conf
cp fail2ban/jail.local /usr/local/etc/fail2ban/jail.local
#update config if source is being used
if [ .$switch_source = .true ]; then
@ -30,8 +33,4 @@ if [ .$switch_source = .true ]; then
fi
#restart fail2ban
#systemd
/bin/systemctl restart fail2ban
#init.d
#/usr/sbin/service fail2ban restart
service fail2ban restart