forked from 74lg0/BARRACUDA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
56 lines (47 loc) · 1.14 KB
/
install.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
#!/bin/bash
# Required packages
required_packages=(
"python3"
"tor"
)
required_pip_packages=(
"threading"
"pystyle"
"requests"
"pysocks"
)
check_installation() {
which $1 > /dev/null 2>&1
}
install_package() {
echo -e "\e[32m[!] Instalando $1\e[0m"
if [ "$(uname)" == "Darwin" ]; then
brew install $1
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
apt-get install $1
fi
}
install_pip_package() {
echo -e "\e[32m[!] Instalando $1\e[0m"
pip install $1
}
main() {
all_installed=true
for package in "${required_packages[@]}"; do
if ! check_installation $package; then
all_installed=false
install_package $package
fi
done
for package in "${required_pip_packages[@]}"; do
if ! python3 -c "import $package" > /dev/null 2>&1; then
all_installed=false
install_pip_package $package
fi
done
if $all_installed; then
echo "Todos los requerimientos ya están instalados"
echo -e "Inicia una instancia de tor en otra pestaña de terminal con el comando: tor"
fi
}
main