-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup
136 lines (117 loc) ยท 5.37 KB
/
setup
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
#!/bin/bash
pprint (){
cred='\033[0;31m'
cgreen='\033[0;32m'
cyellow='\033[0;33m'
cblue='\033[0;34m'
cpurple='\033[0;35m'
eval "export color='$cpurple'"
[ ! -z $2 ] && eval "export color=\"\$$2\""
printf "$color $1"
}
color_reset(){ printf '\033[0;37m';}
yesnoprompt(){
old_stty_cfg=$(stty -g)
stty raw -echo ; answer=$(head -c 1)
stty $old_stty_cfg
echo "$answer" | grep -iq "^y"
}
update() {
pprint "\n\n๐
๐๐ฉ๐๐๐ญ๐ข๐ง๐ ๐๐ ๐๐ฎ๐ฌ๐ข๐ ๐๐๐๐ค๐๐ ๐ ๐๐ข๐ฌ๐ญ ๐.. "
sudo apt update 2>&1 | grep "can be upgraded" &>/dev/null
if [ $? -eq 0 ]; then
pprint "๐จ๐ฝ๐ฑ๐ฎ๐๐ฒ ๐๐๐ฎ๐ถ๐น๐ฎ๐ฏ๐น๐ฒ..๐" "cgreen"
pprint "\n\๐ณ๐พ ๐๐พ๐ ๐๐ฐ๐ฝ๐ ๐๐พ ๐ฐ๐๐๐พ ๐๐ฟ๐ถ๐๐ฐ๐ณ๐ด๐ฅฑ..? (y/n)?"
if yesnoprompt; then
pprint "\n\n๐๐ฉ๐ ๐ซ๐๐๐ข๐ง๐ ๐๐๐๐ค๐๐ ๐๐ฌ๐.. "
sudo apt upgrade -y &>/dev/null &&
pprint "๐๐ฉโ๐ดโ๐ณโ๐ชโโ
!\n\n" "cgreen" || (pprint "โน๏ธ๐ซโ๐ฆโ๐ฎโ๐ฑโโ.\n\n" "cred"; exit 1)
else
echo
fi
else
pprint "\n๐ฆ๐ฅ๐ซ๐๐๐๐ฒ ๐บ๐ฉ ๐น๐จ ๐ฉ๐๐ญ๐\n\n" "cgreen"
fi
}
packages(){
if ! command -v pip &>/dev/null; then
pprint "แดแดแดสแด
ษดแดแด าษชษดแด
แดษชแด, เนษณเธฃฦญฮฑโโเนษณษ ษณฯฯ๐คง..."
sudo apt install python3-pip -y 2>pypilog.txt 1>/dev/null &&
pprint "๐๐๐๐ ๐๐๐๐โ.\n\n" "cgreen" || (pprint "๐๐๐ ๐
๐๐๐๐๐โ.\n\n" "cred"; exit 1)
fi
if ! command -v ffmpeg &>/dev/null; then
pprint "ะกัฒฦฑแD ลัฒฦญ ฦฯฯ
ฮทD าาแดแดแดษข, ๐๐ง๐ฌ๐ญ๐๐ฅ๐ฅ๐ข๐ง๐ ๐๐จ๐ฐ๐..."
if sudo apt install ffmpeg -y &>/dev/null;then
pprint "โ๏ธ ๐ฉ ๐ดโ๐ณโ๐ชโ ๐งโ๐ฆโ๐งโ๐พ โ๏ธโ.\n\n" "cgreen"
else
pprint "๐ซโ๐ฆโ๐ฎโ๐ฑโ๐ชโ๐ฉโ๐.\n\n" "cred"
pprint "You need to install ffmpeg manually in order to deploy VipX Music, exiting...\n" "cblue"
exit 1
fi
fi
# Check ffmpeg version and warn user if necessary.
fv=$(grep -Po 'version (3.*?) ' <<< $(ffmpeg -version)) &&
pprint "Playing live streams not going to work since you have ffmpeg $fv, live streams are supported by version 4+.\n" "cblue"
}
node(){
command -v npm &>/dev/null && return
pprint "๐๐ง๐ฌ๐ญ๐๐ฅ๐ฅ๐ข๐ง๐ ๐๐จ๐๐๐ฃ๐ฌ and ๐๐ฉ๐ฆ๐
.. "
curl -fssL https://deb.nodesource.com/setup_18.x | sudo -E bash - &>nodelog.txt &&
sudo apt install nodejs -y &>>nodelog.txt &&
sudo npm i -g npm &>>nodelog.txt &&
pprint "๐ฆ๐๐ฐ๐ฐ๐ฒ๐๐!\n" "cgreen" || (pprint "FAIL.\n" "cred"; exit 1)
}
installation(){
pprint "\n\n๐จ๐ฝ๐ด๐ฟ๐ฎ๐ฑ๐ถ๐ป๐ด ๐ฝ๐ถ๐ฝ ๐๐ป๐ฑ ๐๐ป๐๐๐ฎ๐น๐น๐ถ๐ป๐ด ๐๐ฒ๐ฝ๐ฒ๐ป๐ฑ๐ฒ๐ฐ๐ ๐ฃ๐ฎ๐ธ๐ฎ๐ด๐ฒ๐๐..."
pip3 install -U pip &>>pypilog.txt &&
pip3 install -U -r requirements.txt &>>pypilog.txt &&
pprint "๐๐จ๐ง๐๐.\n" "cgreen" && return
pprint "๐
๐๐ข๐ฅ๐๐๐ญ.\n" "cred"
exit 1
}
clear
pprint "๐ผแดสแดแดแดแด ๐นแด ๐ฝแด
๐ฒแดsษชแด ๐ธแดแดแดแด\n\n"
sleep 1
pprint "\n\sแดสษชแดแด ษดแดแดแด
s sแดแด
แด แดสษชแด ษชสแดษขแดs ษชษด แดสแด
แดส แดแด แดแดแด
แดแดแด & ษชษดsแดแดสส แดแดแดแดแดษขแดs๐ผ.\n"
sudo test
update
packages
node
installation
pprint "\n\n\n\n\๐ข๐ง ๐ฝย ๐ฉย โ โ ๐ฒโ๐บโ๐ธโ๐ฎโ๐จโ ๐งโ๐ดโ๐นโ" "cgreen"
sleep 1
clear
pptint "\n\n\n\n\n๐
๐ณ"
clear
pprint "\n\n\n\n\n ๐ผ๐
๐
๐ธ๐ฒ"
clear
pprint "\n\n\n\n\n ๐ฑ๐พ๐
"
clear
pprint " ๐ฝย ๐ฉย ๐ฒโ๐บโ๐ธโ๐ฎโ๐จโ ๐งโ๐ดโ๐นโ"
pprint "\n\n๐๐ง๐ญ๐๐ซ ๐๐จ๐ฎ๐ซ ๐๐จ๐ญ ๐๐๐ญ๐ ๐๐๐ฅ๐จ๐ฐ\n\n\n"
pprint "\n๐๐ฃ๐ ๐๐:- "; color_reset; read api_id
pprint "\n๐๐ฃ๐ ๐๐๐ฆ๐:- "; color_reset; read api_hash
pprint "\n๐๐ข๐ง ๐ง๐ข๐๐๐ก:- "; color_reset; read bot_token
pprint "\n๐ข๐ช๐ก๐๐ฅ ๐๐:- "; color_reset; read ownid
pprint "\n๐๐ข๐ง ๐ก๐๐ ๐:- "; color_reset; read mbt
pprint "\n๐ ๐ข๐ก๐๐ข ๐๐:- "; color_reset; read mongo_db
pprint "\n๐๐ข๐ ๐๐ฅ๐ข๐จ๐ฃ ๐๐:- "; color_reset; read logger
pprint "\n๐ฆ๐ง๐ฅ๐๐ก๐ ๐ฆ๐๐ฆ๐ฆ๐๐ข๐ก:- "; color_reset; read string_session
pprint "\n๐๐ฅ๐ข๐จ๐ฃ ๐จ๐ฆ๐๐ฅ๐ก๐๐ ๐:- "; color_reset; read group_username
pprint "\n๐๐๐๐ก๐ก๐๐ ๐จ๐ฆ๐๐ฅ๐ก๐๐ ๐:- "; color_reset; read channel_username
pprint "\n\๐ง๐ท๐๐จ๐๐๐ข๐ง๐ ๐๐จ๐ฎ๐ซ ๐๐๐ซ๐ฌ, ๐๐ฅ๐๐๐ฌ๐ ๐๐๐ข๐ญ ๐๐๐๐ฒโจ๏ธ" "cgreen"
if [ -f .env ]; then
rm .env
fi
echo """API_ID = $api_id
API_HASH = $api_hash
BOT_TOKEN = $bot_token
MONGO_DB_URI = $mongo_db
LOG_GROUP_ID = $logger
GROUP_USERNAME = $group_username
CHANNEL_USERNAME = $channel_username
MUSIC_BOT_NAME = $mbt
STRING_SESSION = $string_session
OWNER_ID = $ownid""" > .env
clear
pprint "\n\n\n\n\\n๐๐๐ ๐๐๐๐๐ ๐๐๐ ๐๐๐ ๐๐ ๐๐๐ ๐๐๐ ๐๐๐๐๐๐๐ \n\n 1๐ฌ๐ญ ๐๐จ๐ฆ๐ฆ๐๐ง๐:- tmux \n 2๐ง๐ ๐๐จ๐ฆ๐ฆ๐๐ง๐:- bash start\n\n"