-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
37 lines (30 loc) · 894 Bytes
/
setup.sh
File metadata and controls
37 lines (30 loc) · 894 Bytes
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
#!/bin/bash
function echo_message {
echo "========================================"
echo "$1"
echo "========================================"
}
echo_message "Atualizando o sistema..."
sudo apt-get update -y
if ! command -v node &> /dev/null
then
echo_message "Instalando Node.js e npm..."
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs
else
echo_message "Node.js já está instalado."
fi
if ! command -v mongo &> /dev/null
then
echo_message "Instalando MongoDB..."
sudo apt-get install -y mongodb
sudo systemctl start mongodb
sudo systemctl enable mongodb
else
echo_message "MongoDB já está instalado."
fi
echo_message "Instalando dependências do projeto..."
npm install
echo_message "Iniciando o aplicativo..."
npm start
echo_message "Setup concluído! O aplicativo está em execução."