mirror of
https://github.com/myvesta/vesta
synced 2025-08-20 13:24:25 -07:00
added multiport chains
This commit is contained in:
parent
4af1e4b92c
commit
7549ba69fa
2 changed files with 19 additions and 9 deletions
|
@ -129,7 +129,14 @@ fi
|
|||
chains=$VESTA/data/firewall/chains.conf
|
||||
for chain in $(cat $chains 2>/dev/null); do
|
||||
eval $chain
|
||||
$iptables -I INPUT -p $PROTOCOL --dport $PORT -j fail2ban-$CHAIN
|
||||
if [[ "$PORT" =~ ,|-|: ]] ; then
|
||||
port="-m multiport --dports $PORT"
|
||||
else
|
||||
port="--dport $PORT"
|
||||
fi
|
||||
echo "$iptables -I INPUT -p $PROTOCOL $port -j fail2ban-$CHAIN" > $tmp
|
||||
bash $tmp
|
||||
rm -f $tmp
|
||||
done
|
||||
|
||||
# Saving rules to the master iptables file
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue