-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
vikaru.sh
314 lines (294 loc) · 8.42 KB
/
vikaru.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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
#!/bin/bash
# DELETING THE WATERMARK IS FORBIDDEN, RESPECT THE DEVELOPER
# - Script by : Maxtream_09
# - Github. : https://github.com/Maxz-09
# - Sosmed : https://linktr.ee/Maxtream_09
# Color definitions
white="\033[00m"
red="\033[31m"
green="\033[32m"
yellow="\033[33m"
# Confirm resource check
enter() {
clear
echo
echo -e $white " # [!] Checking system file. make sure your internet is Good!"
read -r -s -p $' • [?] Press enter to continue....\n'
function back_option () {
clear
}
# Install required resources
echo
echo -e $white "=------------------------------="
echo -e $yellow " # [!] Detect resource..."
echo -e $white "=------------------------------="
sleep 1
check_resource "figlet"
check_resource "pv"
check_resource "git"
check_resource "unzip"
check_resource "nodejs-lts"
check_resource "libwebp"
check_resource "ffmpeg"
echo -e $white "=------------------------------="
sleep 1
echo -e $green " # [✓] All resources installed!"|pv -qL 35
sleep 2
menu
}
# Function to check resource installation
check_resource() {
package_name="$1"
dpkg -s $package_name &> /dev/null
if [ $? -eq 0 ]; then
echo -e $green " • [✓] $package_name installed"
else
echo -e $yellow " • [/] Installing $package_name..."
echo
pkg install "$package_name" -y
echo
echo -e $green " • [✓] $package_name installed"
echo
fi
}
# Vikaru-Menu
menu() {
clear
echo -e -n $white;figlet "Vikaru-Menu"
echo -e $white "=------------------------------="
echo -e " # Select an options [ 1-3 ] :"
echo -e $white "=------------------------------="
echo -e " [1] Install Script"
echo -e " [2] Update Script"
echo -e " [3] Create bot directory ( one-time )"
echo -e " [0] Exit"
echo
read -p " # Select > " choice
case "$choice" in
1)
# Install All script
install
;;
2)
# Update All script
update
;;
3)
# Create bot directory
clear
echo -e -n $white;figlet " Mkdir"
echo -e $white "=----------------------------------="
echo -e " Author : Maxtream_09"
echo -e " GitHub : Maxz-09"
sleep 1
echo
mkdir /storage/emulated/0/.vikaru-bot
mv vikaru.sh /storage/emulated/0/.vikaru-bot
mv .git /storage/emulated/0/.vikaru-bot
echo "echo 'Start : cd /storage/emulated/0/.vikaru-bot && bash vikaru.sh'" > "vikaru.sh"
echo -e $white "=----------------------------------="
echo -e $green " # [✓] mkdir /storage/emulated/0/.vikaru-bot"|pv -qL 30
sleep 1
echo -e $green " # [✓] mv vikaru.sh"|pv -qL 30
echo -e $white "=----------------------------------="
sleep 2
echo -e $yellow " # [!] Start this cmd :"
echo -e $white " "
echo -e $white " cd /storage/emulated/0/.vikaru-bot && bash vikaru.sh"|pv -qL 30
exit
;;
0)
exit 0
;;
*)
echo
echo -e $red" # [!] Input denied"|pv -qL 30
sleep 1
menu
;;
esac
}
# Vikaru-Install
install() {
clear
echo -e -n $white;figlet "Vikaru-Install"
echo -e $white "=------------------------------="
echo -e " # Select an options [ 1-3 ] :"
echo -e $white "=------------------------------="
echo -e " [1] Ar-Vikaru-Bot"
echo -e " [2] Base-Vikaru-Md"
echo -e " [3] Base-Vikaru-Md_demo"
echo -e " [0] Back"
echo
maininstall
}
# Main install
maininstall() {
echo -e -n " # Select > ";read pil
echo
if [ $pil == "1" ];then
# Install Ar-Vikaru-Bot
clear
cd /storage/emulated/0/.vikaru-bot
echo -e -n $white;figlet " Vikaru-Bot"
echo -e $white "=----------------------------------="
echo -e " Author : Maxtream_09"
echo -e " GitHub : Maxz-09"
sleep 1
echo
echo -e $green " • [/] Install Ar-Vikaru-Bot...."|pv -qL 30
sleep 1
echo -e $white
git clone https://github.com/Maxz-09/ar-vikaru-bot
sleep 1
echo
echo -e $green " # [✓] Succssesfully"|pv -qL 30
sleep 2
install
elif [ $pil == "2" ];then
# Install Base-Vikaru-Md
clear
cd /storage/emulated/0/.vikaru-bot
echo -e -n $white;figlet " Vikaru-Md"
echo -e $white "=----------------------------------="
echo -e " Author : Maxtream_09"
echo -e " GitHub : Maxz-09"
sleep 1
echo
echo -e $yellow " • [/] Installing Bot...."|pv -qL 30
echo -e $white " "
git clone https://github.com/Maxz-09/base-vikaru-md
sleep 1
echo
cd /storage/emulated/0/.vikaru-bot/base-vikaru-md
echo -e $green " • [/] Unzip node_modules...."|pv -qL 30
sleep 2
echo -e $white " "
unzip "node_modules.zip"
sleep 1
echo
echo -e $green " # [✓] Succssesfully"|pv -qL 30
sleep 2
install
elif [ $pil == "3" ];then
# Install Base-Vikaru-Md_demo
clear
cd /storage/emulated/0/.vikaru-bot
echo -e -n $white;figlet " Vikaru-Md_demo"
echo -e $white "=----------------------------------="
echo -e " Author : Maxtream_09"
echo -e " GitHub : Maxz-09"
sleep 1
echo
echo -e $yellow " • [/] Installing Bot...."|pv -qL 30
echo -e $white " "
git clone https://github.com/Maxz-09/base-vikaru-md_demo
sleep 1
echo
cd /storage/emulated/0/.vikaru-bot/base-vikaru-md_demo
echo -e $yellow " • [/] Unzip node_modules...."|pv -qL 30
sleep 2
echo -e $white " "
unzip "node_modules.zip"
sleep 1
echo
echo -e $green " # [✓] Succssesfully"|pv -qL 30
sleep 2
install
elif [ $pil == "0" ];then
clear
echo -e $green" # [✓] Back"
menu
else
echo -e $red" # [!] Input denied"|pv -qL 30
sleep 1
install
fi
}
# Vikaru-Update
update() {
clear
echo -e -n $white;figlet "Vikaru-Update"
echo -e $white "=------------------------------="
echo -e " # Select an options [ 1-4 ] :"
echo -e $white "=------------------------------="
echo -e " [1] Vikaru.sh"
echo -e " [2] Ar-Vikaru-Bot"
echo -e " [3] Base-Vikaru-Md"
echo -e " [4] Base-Vikaru-Md_demo"
echo -e " [0] Back"
echo
mainupdate
}
# Main update
mainupdate() {
echo -e -n " # Select > ";read pil
echo
if [ $pil == "1" ];then
# Update vikaru.sh
echo -e $yellow " # [/] Update..."|pv -qL 30
echo -e $white "=----------------------------------="
echo -e $green " • [/] Vikaru-Menu :"
echo -e $white " "
cd /storage/emulated/0/.vikaru-bot/
git config --global --add safe.directory /storage/emulated/0/.vikaru-bot/
git pull
echo -e $white "=----------------------------------="
sleep 1
echo -e $green " # [✓] Succssesfully"|pv -qL 30
sleep 2
update
elif [ $pil == "2" ];then
# Update Ar-Vikaru-Bot
echo -e $yellow " # [/] Update..."|pv -qL 30
echo -e $white "=----------------------------------="
echo -e $green " • [/] Ar-Vikaru-Bot :"
echo -e $white
cd /storage/emulated/0/.vikaru-bot/ar-vikaru-bot
git config --global --add safe.directory /storage/emulated/0/.vikaru-bot/ar-vikaru-bot/
git pull
echo -e $white "=----------------------------------="
sleep 1
echo -e $green " # [✓] Succssesfully"|pv -qL 30
sleep 2
update
elif [ $pil == "3" ];then
# Update Base-Vikaru-Md
echo -e $yellow " # [/] Update..."|pv -qL 30
echo -e $white "=----------------------------------="
echo -e $green " • [/] Ar-Vikaru-Md :"
echo -e $white
cd /storage/emulated/0/.vikaru-bot/base-vikaru-md
git config --global --add safe.directory /storage/emulated/0/.vikaru-bot/base-vikaru-md/
git pull
echo -e $white "=----------------------------------="
sleep 1
echo -e $green " # [✓] Succssesfully"|pv -qL 30
sleep 2
update
elif [ $pil == "4" ];then
# Update Base-Vikaru-Md_demo
echo -e $yellow " # [/] Update..."|pv -qL 30
echo -e $white "=----------------------------------="
echo -e $green " • [/] Ar-Vikaru-Md_demo :"
echo -e $white
cd /storage/emulated/0/.vikaru-bot/base-vikaru-md_demo
git config --global --add safe.directory /storage/emulated/0/.vikaru-bot/base-vikaru-md_demo/
git pull
echo -e $white "=----------------------------------="
sleep 1
echo -e $green " # [✓] Succssesfully"|pv -qL 30
sleep 2
update
elif [ $pil == "0" ];then
clear
echo -e $green" # [✓] Back"
menu
else
echo -e $red" # [!] Input denied"|pv -qL 30
sleep 1
update
fi
}
# Start
enter