2021-11-08 06:35:59

This commit is contained in:
gbaconni
2021-11-08 06:35:59 +01:00
parent 50e2a9c3f4
commit eb20a87072

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/08 06:33:08 by gbaconni ### lausanne.ch # # Updated: 2021/11/08 06:35:57 by gbaconni ### lausanne.ch #
# # # #
# **************************************************************************** # # **************************************************************************** #
@@ -77,18 +77,18 @@ ft_wordpress ()
ft_ufw () ft_ufw ()
{ {
if test -f /etc/rc.local.orig && ! grep -q 'port 443' /etc/rc.local if test -f /etc/rc.local.orig && ! grep -q 'port 4243' /etc/rc.local
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 4243\n\1 4244|' /etc/rc.local
return 0 return 0
fi fi
if ! ufw status | grep -q '^80/tcp' if ! ufw status | grep -q '^4243/tcp'
then then
ufw allow proto tcp from any to any port 80 ufw allow proto tcp from any to any port 4243
fi fi
if ! ufw status | grep -q '^443/tcp' if ! ufw status | grep -q '^4244/tcp'
then then
ufw allow proto tcp from any to any port 443 ufw allow proto tcp from any to any port 4244
fi fi
return 0 return 0
} }