-
Notifications
You must be signed in to change notification settings - Fork 15
/
Eivabot
77 lines (39 loc) · 1.23 KB
/
Eivabot
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
#!/bin/bash
_repolink () {
local regex
regex='(https?)://github.com/.+/.+'
if [[ $Eiva_REPO == "EivaBot" ]]
then
echo "aHR0cHM6Ly9naXRodWIuY29tL1RlYW1FaXZhL0VpdmEtVXNlcmJvdC9hcmNoaXZlL21haW4uemlw" | base64 -d
elif [[ $Eiva_REPO == "Eivabot" ]]
then
echo "aHR0cHM6Ly9naXRodWIuY29tL1RlYW1FaXZhL0VpdmEtVXNlcmJvdC9hcmNoaXZlL21haW4uemlw" | base64 -d
elif [[ $Eiva_REPO =~ $regex ]]
then
if [[ $Eiva_REPO_BRANCH ]]
then
echo "${Eiva_REPO}/archive/${Eiva_REPO_BRANCH}.zip"
else
echo "${Eiva_REPO}/archive/master.zip"
fi
else
echo "aHR0cHM6Ly9naXRodWIuY29tL1RlYW1FaXZhL0VpdmEtVXNlcmJvdC9hcmNoaXZlL21haW4uemlw" | base64 -d
fi
}
start_bot () {
local zippath
zippath="myEivabot.zip"
echo " Downloading source code ..."
wget -q $(_repolink) -O "$zippath"
echo " Unpacking Data ..."
EivaPATH=$(zipinfo -1 "$zippath" | grep -v "/.");
unzip -qq "$zippath"
echo " Processing Codes..."
rm -rf "$zippath"
sleep 5
cd $EivaPATH
echo " • Starting EivaBot • "
python3 ../setup/updater.py ../requirements.txt requirements.txt
python3 -m Eivabot
}
start_bot