-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.sh
199 lines (148 loc) · 6.28 KB
/
app.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
#!/bin/bash
clear
# Utils
function checkStructure() {
echo ''
echo ' [SYS]: Checking installer structure...'
sleep 2
if [ -d './files' ];
then
echo ''
echo ' [SYS]: "Files" folder exists...'
sleep 2
echo ''
echo ' [SYS]: Checking if the installation file exists...'
sleep 2
if [ -f './files/installer.tgz' ];
then
echo ''
echo ' [SYS]: The file exists. Erasing to reinstall...'
rm ./files/installer.tgz
sleep 3
clear
checkStructure
else
echo ''
echo ' [SYS]: File does not exist...'
sleep 2
if [ -d './files/installer' ];
then
echo ''
echo ' [SYS]: "installer" folder exists. Erasing to reinstall...'
sleep 3
rm -Rf ./files/installer
clear
checkStructure
else
echo ''
echo ' [SYS]: "installer" folder does not exist...'
sleep 4
clear
fi
fi
else
echo ''
echo ' [SYS]: "Files" folder does not exist... creating~'
mkdir files
sleep 2
echo ''
echo ' [SYS]: Restarting ...'
sleep 1
clear
checkStructure
fi
}
function banner() {
echo ''
echo ' ██╗███╗ ██╗███████╗████████╗ █████╗ ██╗ ██╗ ███████╗██████╗ '
echo ' ██║████╗ ██║██╔════╝╚══██╔══╝██╔══██╗██║ ██║ ██╔════╝██╔══██╗ '
echo ' ██║██╔██╗ ██║███████╗ ██║ ███████║██║ ██║ █████╗ ██████╔╝ '
echo ' ██║██║╚██╗██║╚════██║ ██║ ██╔══██║██║ ██║ ██╔══╝ ██╔══██╗ '
echo ' ██║██║ ╚████║███████║ ██║ ██║ ██║███████╗███████╗███████╗██║ ██║ '
echo ' ╚═╝╚═╝ ╚═══╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝╚═╝ ╚═╝ '
echo ' ╠════════════════════════════════════════════════════════════════════════════╣ '
echo ' ██████╗ ██╗ ██╗██████╗ █████╗ '
echo ' ██╔══██╗╚██╗ ██╔╝╚════██╗ ██╔══██╗ '
echo ' ██████╔╝ ╚████╔╝ █████╔╝ ╚██████║ '
echo ' ██╔═══╝ ╚██╔╝ ╚═══██╗ ╚═══██║ '
echo ' ██║ ██║ ██████╔╝██╗█████╔╝ '
echo ' ╚═╝ ╚═╝ ╚═════╝ ╚═╝╚════╝ '
}
function getSU() {
sudo echo ' [SYS]: Superuser permissions were released from here...'
}
# Commands
function update() {
echo '═══════════════════════════════════════╣ UPDATE ╠═══════════════════════════════════════'
sudo apt update -y && sudo apt upgrade -y
}
function installDependecies() {
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl libbz2-dev
}
function downloadFile() {
curl -s https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tgz -o files/installer.tgz
sleep 2
echo ''
echo ' [SYS]: File downloaded successfully...'
}
function installPy() {
echo ''
echo ' [SYS]: Starting preparations for installing python ...'
sleep 4
cd files/
tar -zxf installer.tgz
mv Python-3.9.1 installer
cd installer
echo ''
echo ' [SYS]: Starting python3.9 installation ... Dont stop the script once its started!'
sleep 4
clear
banner
echo ''
echo '═══════════════════════════════════════╣ INSTALL ╠═══════════════════════════════════════'
sleep 2
./configure --enable-optimizations
clear
banner
echo ''
echo '═══════════════════════════════════════╣ INSTALL ╠═══════════════════════════════════════'
make -j 2
clear
banner
echo ''
echo '═══════════════════════════════════════╣ INSTALL ╠═══════════════════════════════════════'
sudo make altinstall
clear
banner
echo ''
echo ' [SYS]: Installation was successful...'
sleep 2
echo ''
echo ' [SYS]: Python Version:'
echo ''
python3.9 --verision
}
# Main
function main(){
checkStructure
banner
sleep 3
echo ''
echo ' [SYS]: The script will start in a few seconds...'
sleep 5
echo ''
echo ' [SYS]: Updating the system to receive python 3.9...'
sleep 2
echo ''
echo ' [SYS]: Super user permissions will be used. OK? '
sleep 3
getSU
update
installDependecies
downloadFile
sleep 3
installPy
echo ''
echo ' [SYS]: Check the repository for updates.'
}
main