-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPostInstall.sh
More file actions
executable file
·50 lines (41 loc) · 1.04 KB
/
PostInstall.sh
File metadata and controls
executable file
·50 lines (41 loc) · 1.04 KB
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
#!/usr/bin/env bash
start_time=$(date +%s)
echo "INICIANDO INSTALAÇÃO E CONFIGURAÇÃO AUTOMATIZADA"
# Função para detectar a distribuição
detect_distro() {
if [ -f /etc/debian_version ]; then
echo "debian"
elif [ -f /etc/arch-release ]; then
echo "arch"
elif [ -f /etc/fedora-release ]; then
echo "fedora"
else
echo "unsupported"
fi
}
DISTRO=$(detect_distro)
if [ "$DISTRO" = "unsupported" ]; then
echo "Distribuição não suportada!"
exit 1
fi
# Importar funções comuns
source "$(dirname "$0")/distros/common.sh"
# Importar funções específicas da distribuição
source "$(dirname "$0")/distros/$DISTRO.sh"
######### EXECUÇÃO DAS ETAPAS #########
update
add_repositories
update
install_packages
update
install_snaps
update
install_flatpak
update
run_scripts
update
######### EXECUÇÃO DAS ETAPAS #########
end_time=$(date +%s)
total_time=$((end_time - start_time))
echo "Tempo de execução do script: $total_time segundos."
echo "AMBIENTE CONFIGURADO E INSTALADO COM SUCESSO!"