-
-
Notifications
You must be signed in to change notification settings - Fork 138
/
yartex.sh
154 lines (134 loc) · 13.5 KB
/
yartex.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
# Código creado por @gata_dios
# Modificado por @AzamiJs
#!/data/data/com.termux/files/usr/bin/bash
# Interpretación determinada para la ejecución
COMANDOS = "pkg install git -y\npkg install nodejs -y\npkg install ffmpeg -y\npkg install imagemagick -y\npkg install -y yarn\ngit clone https://github.com/GataNina-Li/YartexBot-MD\ncd YartexBot-MD\nyarn install\nnpm install\nnpm start"
echo -e "\e[38;5;123m
─█▀▀█ ───░█ ░█─░█ ░█▀▀▀█ ▀▀█▀▀ ░█▀▀▀ ░█─── ─█▀▀█ ░█▀▀█ ─█▀▀█ ░█▄─░█ ▀▀█▀▀ ─█▀▀█ ░█─── ░█─── ─█▀▀█
░█▄▄█ ─▄─░█ ░█─░█ ─▀▀▀▄▄ ─░█── ░█▀▀▀ ░█─── ░█▄▄█ ░█▄▄█ ░█▄▄█ ░█░█░█ ─░█── ░█▄▄█ ░█─── ░█─── ░█▄▄█
░█─░█ ░█▄▄█ ─▀▄▄▀ ░█▄▄▄█ ─░█── ░█▄▄▄ ░█▄▄█ ░█─░█ ░█─── ░█─░█ ░█──▀█ ─░█── ░█─░█ ░█▄▄█ ░█▄▄█ ░█─░█\n\e[0m"
echo -e "\033[1;38;5;79mEmpezando instalación...\n\033[0m"
echo -e "\033[38;5;165m\033[01mInstalando dependencias!!\n\033[0m"
echo -e "\e[38;5;49m
█ █▄░█ █▀ ▀█▀ ▄▀█ █░░ █░░ █▀▀ █ ▀█▀
█ █░▀█ ▄█ ░█░ █▀█ █▄▄ █▄▄ █▄█ █ ░█░\n\e[0m"
if command -v git >/dev/null 2>&1; then
echo -e "\033[1;38;5;3m\033[1mGit ya estaba instalado anteriormente.\033[0m"
else
if pkg install git -y 2>&1 >/dev/null | grep -E -i -q '(command not found|unable to locate package|E: Could not get lock|debconf: delaying package configuration|Package not found|Failed to fetch|404 Not Found|Hash sum mismatch|503 Service Unavailable|504 Gateway Timeout|408 Request Timeout|Connection timed out|Temporary failure resolving)'; then
error=$(pkg install git -y 2>&1 >/dev/null)
echo -e "\033[1;38;5;196m\033[1mError: $error\033[0m"
echo -e "\033[0;34m\033[1mNo se pudo instalar Git. Verifique su conexión a internet e inténtelo de nuevo. Si el error continúa, instale de forma manual!!\033[0m"
echo -e "\033[01;33m\033[1m$COMANDOS\033[0m"
exit 1
else
echo -e "\033[1;38;5;2m\033[01mGit se ha instalado correctamente.\n\033[0m"
fi
fi
echo -e "\e[38;5;206m
█ █▄░█ █▀ ▀█▀ ▄▀█ █░░ █░░ █▄░█ █▀█ █▀▄ █▀▀ ░ ░░█ █▀
█ █░▀█ ▄█ ░█░ █▀█ █▄▄ █▄▄ █░▀█ █▄█ █▄▀ ██▄ ▄ █▄█ ▄█\n\e[0m"
if command -v node >/dev/null 2>&1; then
echo -e "\033[1;38;5;3m\033[1mNodejs ya estaba instalado anteriormente.\033[0m"
else
if pkg install nodejs -y 2>&1 >/dev/null | grep -E -i -q '(command not found|unable to locate package|E: Could not get lock|debconf: delaying package configuration|Package not found|Failed to fetch|404 Not Found|Hash sum mismatch|503 Service Unavailable|504 Gateway Timeout|408 Request Timeout|Connection timed out|Temporary failure resolving)'; then
error=$(pkg install nodejs -y 2>&1 >/dev/null)
echo -e "\033[1;38;5;196m\033[1mError: $error\033[0m"
echo -e "\033[0;34m\033[1mNo se pudo instalar Node.js. Verifique su conexión a Internet e inténtelo de nuevo. Si el error continúa, instale de forma manual!!\033[0m"
echo -e "\033[01;33m\033[1m$COMANDOS\033[0m"
exit 1
else
echo -e "\033[1;38;5;2m\033[01mNode.js se ha instalado correctamente.\n\033[0m"
fi
fi
echo -e "\e[38;5;49m
█ █▄░█ █▀ ▀█▀ ▄▀█ █░░ █░░ █▀▀ █▀▀ █▀▄▀█ █▀█ █▀▀ █▀▀
█ █░▀█ ▄█ ░█░ █▀█ █▄▄ █▄▄ █▀░ █▀░ █░▀░█ █▀▀ ██▄ █▄█\n\e[0m"
if command -v ffmpeg >/dev/null 2>&1; then
echo -e "\033[1;38;5;3m\033[1mFfmpeg ya estaba instalado anteriormente.\033[0m"
else
if pkg install ffmpeg -y 2>&1 >/dev/null | grep -E -i -q '(command not found|unable to locate package|E: Could not get lock|debconf: delaying package configuration|Package not found|Failed to fetch|404 Not Found|Hash sum mismatch|503 Service Unavailable|504 Gateway Timeout|408 Request Timeout|Connection timed out|Temporary failure resolving)'; then
error=$(pkg install ffmpeg -y 2>&1 >/dev/null)
echo -e "\033[1;38;5;196m\033[1mError: $error\033[0m"
echo -e "\033[0;34m\033[1mNo se pudo instalar FFmpeg. Verifique su conexión a Internet e inténtelo de nuevo. Si el error continúa, instale de forma manual!!\033[0m"
echo -e "\033[01;33m\033[1m$COMANDOS\033[0m"
exit 1
else
echo -e "\033[1;38;5;2m\033[01mFFmpeg se ha instalado correctamente.\n\033[0m"
fi
fi
echo -e "\e[38;5;206m
█ █▄░█ █▀ ▀█▀ ▄▀█ █░░ █░░ █ █▀▄▀█ ▄▀█ █▀▀ █▀▀ █▀▄▀█ ▄▀█ █▀▀ █ █▀▀ █▄▀
█ █░▀█ ▄█ ░█░ █▀█ █▄▄ █▄▄ █ █░▀░█ █▀█ █▄█ ██▄ █░▀░█ █▀█ █▄█ █ █▄▄ █░█\n\e[0m"
if command -v convert >/dev/null 2>&1; then
echo -e "\033[1;38;5;3m\033[1mImagemagick ya estaba instalado anteriormente.\033[0m"
else
if pkg install imagemagick -y 2>&1 >/dev/null | grep -E -i -q '(command not found|unable to locate package|E: Could not get lock|debconf: delaying package configuration|Package not found|Failed to fetch|404 Not Found|Hash sum mismatch|503 Service Unavailable|504 Gateway Timeout|408 Request Timeout|Connection timed out|Temporary failure resolving)'; then
error=$(pkg install imagemagick -y 2>&1 >/dev/null)
echo -e "\033[1;38;5;196m\033[1mError: $error\033[0m"
echo -e "\033[0;34m\033[1mNo se pudo instalar ImageMagick. Verifique su conexión a Internet e inténtelo de nuevo. Si el error continúa, instale de forma manual!!\033[0m"
echo -e "\033[01;33m\033[1m$COMANDOS\033[0m"
exit 1
else
echo -e "\033[1;38;5;2m\033[01mImageMagick se ha instalado correctamente.\n\033[0m"
fi
fi
echo -e "\e[38;5;49m
█ █▄░█ █▀ ▀█▀ ▄▀█ █░░ █░░ █▄█ ▄▀█ █▀█ █▄░█
█ █░▀█ ▄█ ░█░ █▀█ █▄▄ █▄▄ ░█░ █▀█ █▀▄ █░▀█\n\e[0m"
if command -v yarn >/dev/null 2>&1; then
echo -e "\033[1;38;5;3m\033[1mYarn ya estaba instalado anteriormente.\033[0m"
else
if npm install -g yarn 2>&1 >/dev/null | grep -E -i -q '(command not found|unable to locate package|E: Could not get lock|debconf: delaying package configuration|Package not found|Failed to fetch|404 Not Found|Hash sum mismatch|503 Service Unavailable|504 Gateway Timeout|408 Request Timeout|Connection timed out|Temporary failure resolving)'; then
error=$(npm install -g yarn 2>&1 >/dev/null)
echo -e "\033[1;38;5;196m\033[1mError: $error\033[0m"
echo -e "\033[0;34m\033[1mNo se pudo instalar Yarn. Verifique su conexión a Internet e inténtelo de nuevo. Si el error continúa, instale de forma manual!!\033[0m"
echo -e "\033[01;33m\033[1m$COMANDOS\033[0m"
exit 1
else
echo -e "\033[1;38;5;2m\033[01mYarn se ha instalado correctamente.\n\033[0m"
fi
fi
echo -e "\033[38;5;266m
▀▀█▀▀ ▒█▀▀▀█ ▒█▀▀▄ ▒█▀▀▀█ ▒█▀▀█ ▒█▀▀▀█ ▒█▀▀█ ▒█▀▀█ ▒█▀▀▀ ▒█▀▀█ ▀▀█▀▀ ▒█▀▀▀█
░▒█░░ ▒█░░▒█ ▒█░▒█ ▒█░░▒█ ▒█░░░ ▒█░░▒█ ▒█▄▄▀ ▒█▄▄▀ ▒█▀▀▀ ▒█░░░ ░▒█░░ ▒█░░▒█
░▒█░░ ▒█▄▄▄█ ▒█▄▄▀ ▒█▄▄▄█ ▒█▄▄█ ▒█▄▄▄█ ▒█░▒█ ▒█░▒█ ▒█▄▄▄ ▒█▄▄█ ░▒█░░ ▒█▄▄▄█\e[0m"
echo -e "\033[38;5;183m\033[01mTodas las dependencias se han instalado correctamente.\n\033[0m"
echo -e "\e[38;5;81m
██╗░░██╗░░██╗░░ ██╗███╗░░██╗░██████╗████████╗░█████╗░██╗░░░░░██╗░░░░░
╚██╗░╚██╗░╚██╗░ ██║████╗░██║██╔════╝╚══██╔══╝██╔══██╗██║░░░░░██║░░░░░
░╚██╗░╚██╗░╚██╗ ██║██╔██╗██║╚█████╗░░░░██║░░░███████║██║░░░░░██║░░░░░
░██╔╝░██╔╝░██╔╝ ██║██║╚████║░╚═══██╗░░░██║░░░██╔══██║██║░░░░░██║░░░░░
██╔╝░██╔╝░██╔╝░ ██║██║░╚███║██████╔╝░░░██║░░░██║░░██║███████╗███████╗
╚═╝░░╚═╝░░╚═╝░░ ╚═╝╚═╝░░╚══╝╚═════╝░░░░╚═╝░░░╚═╝░░╚═╝╚══════╝╚══════╝\n\e[0m"
echo -e "\033[38;5;188m"
git clone https://github.com/GataNina-Li/YartexBot-MD.git
echo -e "\033[38;5;51m\033[01mLa clonación se ha descargado e instalado correctamente.\n\033[0m"
echo -e "\033[1;38;5;171mCambiando al directorio del repositorio!!\n\033[0m"
cd YartexBot-MD
echo -e "\e[38;5;111m
█░█ █▀█ █▀▄ ▄▀█ ▀█▀ █▀▀ █▄█ ▄▀█ █▀█ █▄░█
█▄█ █▀▀ █▄▀ █▀█ ░█░ ██▄ ░█░ █▀█ █▀▄ █░▀█\n\e[0m"
echo -e "\033[1;38;5;229m\033[1mSe actualizará yarn automáticamente. Esto puede tomar tiempo, Espere por favor.\n\033[0m"
if yarn install 2>&1 >/dev/null | grep -E -i -q '(command not found|unable to locate package|E: Could not get lock|debconf: delaying package configuration|Package not found|Failed to fetch|404 Not Found|Hash sum mismatch|503 Service Unavailable|504 Gateway Timeout|408 Request Timeout|Connection timed out|Temporary failure resolving)'; then
error=$(yarn install 2>&1 >/dev/null)
echo -e "\033[1;38;5;196m\033[1mError: $error\033[0m"
echo -e "\033[0;34m\033[1mNo se pudo instalar yarn. Verifique su conexión a Internet e inténtelo de nuevo. Si el error continúa, instale de forma manual!!\033[0m"
else
echo -e "\033[1;38;5;2m\033[01mYarn se ha actualizado correctamente.\n\033[0m"
fi
clear
echo -e "\e[38;38;5;69m
██╗███╗░░██╗██╗░█████╗░██╗░█████╗░███╗░░██╗██████╗░░█████╗░
██║████╗░██║██║██╔══██╗██║██╔══██╗████╗░██║██╔══██╗██╔══██╗
██║██╔██╗██║██║██║░░╚═╝██║███████║██╔██╗██║██║░░██║██║░░██║
██║██║╚████║██║██║░░██╗██║██╔══██║██║╚████║██║░░██║██║░░██║
██║██║░╚███║██║╚█████╔╝██║██║░░██║██║░╚███║██████╔╝╚█████╔╝
╚═╝╚═╝░░╚══╝╚═╝░╚════╝░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝╚═════╝░░╚════╝░
██╗░░░██╗░█████╗░██████╗░████████╗███████╗██╗░░██╗██████╗░░█████╗░████████╗░░░░░░███╗░░░███╗██████╗░
╚██╗░██╔╝██╔══██╗██╔══██╗╚══██╔══╝██╔════╝╚██╗██╔╝██╔══██╗██╔══██╗╚══██╔══╝░░░░░░████╗░████║██╔══██╗
░╚████╔╝░███████║██████╔╝░░░██║░░░█████╗░░░╚███╔╝░██████╦╝██║░░██║░░░██║░░░█████╗██╔████╔██║██║░░██║
░░╚██╔╝░░██╔══██║██╔══██╗░░░██║░░░██╔══╝░░░██╔██╗░██╔══██╗██║░░██║░░░██║░░░╚════╝██║╚██╔╝██║██║░░██║
░░░██║░░░██║░░██║██║░░██║░░░██║░░░███████╗██╔╝╚██╗██████╦╝╚█████╔╝░░░██║░░░░░░░░░██║░╚═╝░██║██████╔╝
░░░╚═╝░░░╚═╝░░╚═╝╚═╝░░╚═╝░░░╚═╝░░░╚══════╝╚═╝░░╚═╝╚═════╝░░╚════╝░░░░╚═╝░░░░░░░░░╚═╝░░░░░╚═╝╚═════╝░\n\e[0m"
npm start