-
Notifications
You must be signed in to change notification settings - Fork 5
/
setup.sh
87 lines (64 loc) · 2.78 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/bash
while :
do
clear
echo
banner(){
echo
echo -e "\033[34m ███ ██ ███████ ██ ██ ████████ ██████ ██ ██████ ██ ██ ██████ \033[0m"
echo -e "\033[34m ████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ \033[0m"
echo -e "\033[34m ██ ██ ██ █████ ███ ██ ██ ██ ██ ██ ██ ██ ██ ██ \033[0m"
echo -e "\033[34m ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ \033[0m"
echo -e "\033[34m ██ ████ ███████ ██ ██ ██ ██████ ███████ ██████ ██████ ██████ \033[0m"
echo -e "\033[34m \033[0m"
echo -e "\033[34m \033[0m"
}
banner
echo
int_handler (){
clear
echo
echo -e "\033[1m [+] Adios \033[0m"
kill $PPID
exit 1
}
trap 'int_handler' INT
if [ "$(id -u)" != "0" ]; then
echo -e "\033[1m Ejecute este script como root (usando sudo). \033[0m"
exit 1
fi
echo
echo
echo -e " \033[1m [1] Instalar Requisitos \033[0m"
echo -e " \033[1m [2] Configurar Nextcloud \033[0m"
echo -e " \033[1m [3] Configurar seguridad de Directorios \033[0m"
echo -e " \033[1m [4] Salir \033[0m"
echo
read -p $'\033[1m [+] Seleccione una opción: \033[0m' opcion
case $opcion in
1) echo
# Actualizar paquetes y sistema
apt update
apt upgrade
# Agregar repositorio PHP
add-apt-repository ppa:ondrej/php
# Instalar PHP 8.1 y sus extensiones necesarias
apt-get install php8.1 php8.1-common php8.1-mysql php8.1-pgsql php8.1-xml php8.1-mbstring php8.1-curl php8.1-gd php8.1-zip php8.1-intl
# Actualizar paquetes de nuevo
apt-get update
# Instalar servidor MySQL y configurarlo
apt install mysql-server -y
echo -e " \033[1m [+] Requisitos instalados \033[0m"
sleep 1.5;;
2) echo
source Scripts/configuracion.sh;;
3) echo
source Scripts/directorios.sh
sleep 1.5;;
4) echo
clear
echo -e "\033[1m [+] Adios\033[0m"
exit;;
esac
echo
done