Scripts de firewall iptables compatíveis com docker e com fail2log.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

33 lines
693 B

#!/bin/bash
if [ "$USER" != "root" ] ; then
printf "Are you root? \nsudo ./install.sh\n"
exit 1
fi
#if [ "X$(which dialog)" == "X" ]; then
# apt -y install dialog
#fi
if [ "X$(which fail2ban-client)" == "X" ]; then
apt -y install fail2ban
fi
if [ ! -d /etc/network/firewall ] ; then
mkdir -p /etc/network/firewall
fi
cp -v firewall.service /etc/systemd/system/
cp -v firewall-init.service /etc/systemd/system/
systemctl enable firewall.service
systemctl enable firewall-init.service
if [ ! -f /etc/network/firewall/rules.sh ] ; then
cp -v rules.sh /etc/network/firewall/
fi
if [ ! -f /etc/network/firewall/init.sh ] ; then
cp -v init.sh /etc/network/firewall/
fi