File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -1227,6 +1227,15 @@ if [ "$fail2ban" = 'yes' ]; then
12271227 fline=$( echo " $fline " | grep enabled | tail -n1 | cut -f 1 -d -)
12281228 sed -i " ${fline} s/true/false/" /etc/fail2ban/jail.local
12291229 fi
1230+ if [ " $vsftpd " = ' yes' ]; then
1231+ # Create vsftpd Log File
1232+ if [ ! -f " /var/log/vsftpd.log" ]; then
1233+ touch /var/log/vsftpd.log
1234+ fi
1235+ fline=$( cat /etc/fail2ban/jail.local | grep -n vsftpd-iptables -A 2)
1236+ fline=$( echo " $fline " | grep enabled | tail -n1 | cut -f 1 -d -)
1237+ sed -i " ${fline} s/false/true/" /etc/fail2ban/jail.local
1238+ fi
12301239 chkconfig fail2ban on
12311240 /bin/mkdir -p /var/run/fail2ban
12321241 sed -i " s/\[Service\]/\[Service\]\nExecStartPre = \/bin\/mkdir -p \/var\/run\/fail2ban/g" /usr/lib/systemd/system/fail2ban.service
Original file line number Diff line number Diff line change @@ -1172,6 +1172,15 @@ if [ "$fail2ban" = 'yes' ]; then
11721172 fline=$( echo " $fline " | grep enabled | tail -n1 | cut -f 1 -d -)
11731173 sed -i " ${fline} s/true/false/" /etc/fail2ban/jail.local
11741174 fi
1175+ if [ " $vsftpd " = ' yes' ]; then
1176+ # Create vsftpd Log File
1177+ if [ ! -f " /var/log/vsftpd.log" ]; then
1178+ touch /var/log/vsftpd.log
1179+ fi
1180+ fline=$( cat /etc/fail2ban/jail.local | grep -n vsftpd-iptables -A 2)
1181+ fline=$( echo " $fline " | grep enabled | tail -n1 | cut -f 1 -d -)
1182+ sed -i " ${fline} s/false/true/" /etc/fail2ban/jail.local
1183+ fi
11751184 update-rc.d fail2ban defaults
11761185 service fail2ban start
11771186 check_result $? " fail2ban start failed"
You can’t perform that action at this time.
0 commit comments