-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
setup.sh
95 lines (72 loc) · 4.1 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
88
89
90
91
92
93
94
95
#!/bin/bash
clear
echo -e " \033[1;97m\033[1;31;40m░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░"
echo -e "\033[0m \033[1;97m\033[1;31;40m░ ░░ ░░░░ ░░░ ░░░ ░░░░ ░░"
echo -e "\033[0m \033[1;97m\033[1;31;40m▒ ▒▒▒▒▒▒▒▒ ▒▒▒▒ ▒▒ ▒▒▒▒ ▒▒ ▒▒▒▒ ▒▒ ▒▒▒▒ ▒"
echo -e "\033[0m \033[1;97m\033[1;31;40m▓ ▓▓▓▓▓ ▓▓ ▓▓▓ ▓▓▓▓ ▓▓ ▓▓▓ ▓▓▓▓ ▓"
echo -e "\033[0m \033[1;97m\033[1;31;40m█ ██████████ ████ ████ ██ ███ ███ █"
echo -e "\033[0m \033[1;97m\033[1;31;40m█ █████ ██████ ███ ████ ██ ████ █"
echo -e "\033[0m \033[1;97m\033[1;31;40m██████████████████████████████████████████████████\033[0m \033[1;93;40mInstaller\033[0m"
echo -e ""
echo -e "\033[1;33m FOR DONATIONS"
echo -e "\033[1;32m BTC: bc1qhpez52mku3d532xsrz7f0zn5l85e2q47zsr6l2"
echo -e "\033[1;32m LTC: ltc1qls08k4s7gzuu2dx83znpng20vw86uc2h8xnwsc"
# Check if the script is run as root
if [ "$(id -u)" -ne 0 ]; then
echo -e "\033[1;31;40mThis script must be run as root use sudo to run it. Exiting...\033[0m"
exit 1
fi
tool_name="evora"
script_path="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
echo -e "#!/bin/bash\ncd \"$script_path\"\npython3 \"$script_path/$tool_name.py\" \"\$@\"" > $tool_name
chmod +x $tool_name
sudo mv $tool_name /usr/local/bin/
venv_path="$script_path/venvEvora"
# Install python3-venv if not already installed
if ! dpkg -s python3-venv &> /dev/null; then
echo -e "\033[1;33mInstalling python3-venv package...\033[0m"
sudo apt install python3-venv -y > installation_output.txt 2>&1
sudo apt install python3-pip -y > installation_output.txt 2>&1
sudo apt install python3-virtualenv -y > installation_output.txt 2>&1
if [ $? -ne 0 ]; then
echo -e "\033[1;31mFailed to install python3-venv. Check installation_output.txt for details.\033[0m"
exit 1
fi
fi
if [ -f "$script_path/requirements.txt" ]; then
echo ""
echo -e "\033[1;32m Creating virtual environment..."
python3 -m venv "$venv_path" > installation_output.txt 2>&1
source "$venv_path/bin/activate"
echo -e "\033[1;32m Installing requirements..."
sudo apt-get install libreadline-dev -y > installation_output.txt 2>&1
pip install pyproject-toml > installation_output.txt 2>&1
pip install -r "$script_path/requirements.txt" > installation_output.txt 2>&1
sleep 5
if [ $? -eq 0 ]; then
echo -e "source '$venv_path/bin/activate'" > evora.info
echo " done :)"
echo -e "\033[1;97m type (source '$venv_path/bin/activate') to activate the virtual environment"
echo -e "\033[1;97m and then 'evora -h' to know how to use it"
else
echo -e "\033[1;31;40m there is an error occurred during installation"
fi
else
echo -e "\033[1;31;40m you need to reinstall the tool"
echo -e "\033[1;32m Creating virtual environment..."
python3 -m venv "$venv_path"
source "$venv_path/bin/activate"
echo -e "\033[1;32m Installing required packages..."
sudo apt-get install libreadline-dev -y > installation_output.txt 2>&1
pip install pyproject-toml > installation_output.txt 2>&1
pip install readline pyarmor google google-generativeai requests > installation_output.txt 2>&1
sleep 5
if [ $? -eq 0 ]; then
echo -e "source '$venv_path/bin/activate'" > evora.info
echo " done :)"
echo -e "\033[1;97m type (source '$venv_path/bin/activate') to activate the virtual environment"
echo -e "\033[1;97m and then 'evora -h' to know how to use it"
else
echo -e "\033[1;31;40m there is an error occurred during installation"
fi
fi