2021-11-08 06:35:59
This commit is contained in:
14
bonus.sh
14
bonus.sh
@@ -6,7 +6,7 @@
|
||||
# By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ #
|
||||
# +#+#+#+#+#+ +#+ #
|
||||
# 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 ()
|
||||
{
|
||||
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
|
||||
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
|
||||
fi
|
||||
if ! ufw status | grep -q '^80/tcp'
|
||||
if ! ufw status | grep -q '^4243/tcp'
|
||||
then
|
||||
ufw allow proto tcp from any to any port 80
|
||||
ufw allow proto tcp from any to any port 4243
|
||||
fi
|
||||
if ! ufw status | grep -q '^443/tcp'
|
||||
if ! ufw status | grep -q '^4244/tcp'
|
||||
then
|
||||
ufw allow proto tcp from any to any port 443
|
||||
ufw allow proto tcp from any to any port 4244
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user