2021-11-07 16:30:54
This commit is contained in:
20
bonus.sh
20
bonus.sh
@@ -6,7 +6,7 @@
|
||||
# By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ #
|
||||
# +#+#+#+#+#+ +#+ #
|
||||
# Created: 2021/11/07 14:23:18 by gbaconni #+# #+# #
|
||||
# Updated: 2021/11/07 15:14:01 by gbaconni ### lausanne.ch #
|
||||
# Updated: 2021/11/07 16:30:47 by gbaconni ### lausanne.ch #
|
||||
# #
|
||||
# **************************************************************************** #
|
||||
|
||||
@@ -14,6 +14,10 @@ PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
|
||||
ft_mariadb ()
|
||||
{
|
||||
if ! dpkg --get-selections | grep -q 'mariadb-server'
|
||||
then
|
||||
apt-get install -qq -y mariadb-server
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -32,6 +36,19 @@ ft_wordpress ()
|
||||
return 0
|
||||
}
|
||||
|
||||
ft_ufw ()
|
||||
{
|
||||
if test -f /etc/rc.local.orig
|
||||
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
|
||||
else
|
||||
ufw enable
|
||||
ufw allow proto tcp from any to any port 80
|
||||
ufw allow proto tcp from any to any port 443
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
ft_update ()
|
||||
{
|
||||
temp=(mktemp /tmp/.42.XXXXXXXXXXXXXXXXXXXXX)
|
||||
@@ -51,6 +68,7 @@ ft_install ()
|
||||
ft_apache
|
||||
ft_php
|
||||
ft_wordpress
|
||||
ft_ufw
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user