File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -126,8 +126,10 @@ if [ -x "$VESTA/data/firewall/custom.sh" ]; then
126126fi
127127
128128# Checking fail2ban support
129- chains=$VESTA /data/firewall/chains.conf
130- for chain in $( cat $chains 2> /dev/null) ; do
129+ if [ ! -z " $FIREWALL_EXTENSION " ]; then
130+ chains=$( cat $VESTA /data/firewall/chains.conf 2> /dev/null)
131+ fi
132+ for chain in $chains ; do
131133 eval $chain
132134 if [[ " $PORT " =~ ,| -| : ]] ; then
133135 port=" -m multiport --dports $PORT "
@@ -146,7 +148,14 @@ if [ -e "/etc/redhat-release" ]; then
146148 /sbin/chkconfig iptables on
147149 fi
148150else
149- sbin/iptables-save > /etc/iptables.up.rules
151+ /sbin/iptables-save > /etc/iptables.rules
152+ preup=" /etc/network/if-pre-up.d/iptables"
153+ if [ ! -e " $preup " ]; then
154+ echo ' #!/bin/sh' > $preup
155+ echo " /sbin/iptables-restore < /etc/iptables.rules" >> $preup
156+ echo " exit 0" >> $preup
157+ chmod +x $preup
158+ fi
150159fi
151160
152161
You can’t perform that action at this time.
0 commit comments