2021-11-07 16:47:55

This commit is contained in:
gbaconni
2021-11-07 16:47:55 +01:00
parent 1a3828558f
commit dea8c82c28

View File

@@ -6,7 +6,7 @@
# By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ # # By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ # # +#+#+#+#+#+ +#+ #
# Created: 2021/11/07 14:23:18 by gbaconni #+# #+# # # Created: 2021/11/07 14:23:18 by gbaconni #+# #+# #
# Updated: 2021/11/07 16:45:47 by gbaconni ### lausanne.ch # # Updated: 2021/11/07 16:47:52 by gbaconni ### lausanne.ch #
# # # #
# **************************************************************************** # # **************************************************************************** #
@@ -41,7 +41,8 @@ ft_ufw ()
if test -f /etc/rc.local.orig if test -f /etc/rc.local.orig
then then
sed -i -r 's|(/usr/sbin/ufw allow proto tcp from any to any port)(.+)|\1\2\n\1 80\n\1 443|' /etc/rc.local sed -i -r 's|(/usr/sbin/ufw allow proto tcp from any to any port)(.+)|\1\2\n\1 80\n\1 443|' /etc/rc.local
else return 0
fi
if ! ufw status | grep -q '^80/tcp' if ! ufw status | grep -q '^80/tcp'
then then
ufw allow proto tcp from any to any port 80 ufw allow proto tcp from any to any port 80
@@ -50,7 +51,6 @@ ft_ufw ()
then then
ufw allow proto tcp from any to any port 443 ufw allow proto tcp from any to any port 443
fi fi
fi
return 0 return 0
} }