-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinstall.sh
313 lines (288 loc) · 8.64 KB
/
install.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
#!/bin/bash
# Version: v1.0
# TS3 Client Version: 3.5.3 [Stable]
# YouTube-DL Version: /
# Tested on: Debian 9, Debian 10
#variables
MACHINE=$(uname -m)
Version="v1.0"
IPADDR=$(ip route get 8.8.8.8 | awk {'print $7'} | tr -d '\n')
PW=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1)
AUTHOR="OBGP"
#functs
function greenMessage() {
echo -e "\\033[32;1m${*}\\033[0m"
}
function magentaMessage() {
echo -e "\\033[35;1m${*}\\033[0m"
}
function cyanMessage() {
echo -e "\\033[36;1m${*}\\033[0m"
}
function redMessage() {
echo -e "\\033[31;1m${*}\\033[0m"
}
function yellowMessage() {
echo -e "\\033[33;1m${*}\\033[0m"
}
function errorQuit() {
errorExit 'Exit now!'
}
function errorExit() {
redMessage "${@}"
exit 1
}
function errorContinue() {
redMessage "Invalid option."
return
}
function ytdl() {
wget -q -O /usr/local/bin/youtube-dl http://yt-dl.org/downloads/latest/youtube-dl
clear
chmod a+rx /usr/local/bin/youtube-dl
youtube-dl -U --restrict-filename
}
#check is it root
if [ "$(id -u)" != "0" ]; then
errorExit "Change to root account required!"
fi
clear
#print tos
greenMessage "This is the automatic cracked SinusBot installer. USE AT YOUR OWN RISK"!
sleep 1
cyanMessage "You can choose between installing, upgrading and removing the SinusBot."
sleep 1
redMessage "Installer by $AUTHOR | OBGP.GITHUB.IO"
sleep 1
yellowMessage "You're using installer $Version"
#print options
redMessage "What should the installer do?"
OPTIONS=("Install" "Update" "Remove Instance" "PW Reset" "Start Instance" "Stop Instance" "YouTube-DL Install" "Quit")
select OPTION in "${OPTIONS[@]}"; do
case "$REPLY" in
1 | 2 | 3 | 4 | 5 | 6 | 7) break ;;
5) errorQuit ;;
*) errorContinue ;;
esac
done
if [ "$OPTION" == "Install" ]; then
INSTALL="Inst"
elif [ "$OPTION" == "Update" ]; then
INSTALL="Updt"
elif [ "$OPTION" == "Remove Instance" ]; then
INSTALL="Rem"
elif [ "$OPTION" == "PW Reset" ]; then
INSTALL="Res"
elif [ "$OPTION" == "Start Instance" ]; then
INSTALL="Start"
elif [ "$OPTION" == "Stop Instance" ]; then
INSTALL="Stop"
elif [ "$OPTION" == "YouTube-DL Install" ]; then
INSTALL="Ytdl"
elif [ "$OPTION" == "Quit" ]; then
INSTALL="Quit"
fi
# update opt
if [ "$INSTALL" == "Updt" ]; then
clear
greenMessage "Not available in cracked script!"
fi
#install opt
if [ "$INSTALL" == "Inst" ]; then
greenMessage "Installing depencies..."
sleep 0.5
clear
#installing depencies
apt-get install wget unzip -y
apt-get update
apt-get install debconf-utils -y
apt-get install lsb-release -y
apt-get update
apt-get upgrade -y
apt-get install chrony -y
apt-get install ntp -y
apt-get install -y libfontconfig libxtst6 screen xvfb libxcursor1 ca-certificates bzip2 psmisc libglib2.0-0 less cron-apt python iproute2 dbus libnss3 libegl1-mesa x11-xkb-utils libasound2 libxcomposite-dev libxi6 libpci3 libxslt1.1 libxkbcommon0 libxss1
update-ca-certificates
apt-get install ca-certificates bzip2 python wget -y
update-ca-certificates
clear
greenMessage "Installing YouTube-DL..."
sleep 0.5
clear
ytdl #calling ytdl install func
clear
greenMessage "Now enter port to install."
read -p "Port [eg. 8087]: " portinst
clear
greenMessage "Now enter password for instance."
read -p "Password [eg. obgp]: " passinst
greenMessage "Allright, installing that port :P"
#adding user
adduser --disabled-login --home /opt/SinusPort-$portinst --gecos "" SinusPort-$portinst --force-badname
clear
greenMessage "Added user: SinusPort-$portinst in /opt/SinusPort-$portinst"
sleep 0.5
clear
#updating
apt-get update
apt-get upgrade -y
#update certificates
update-ca-certificates
clear
rm -rf /tmp/.X11-unix
rm -rf /tmp/.sinusbot.lock
cd /opt/SinusPort-$portinst
#downloading required files
su -c "cd; wget https://github.com/obgp/CDN/raw/main/phpmulti-sinusbot.zip" SinusPort-$portinst
su -c "cd; wget https://github.com/obgp/CDN/raw/main/ts3php.zip" SinusPort-$portinst
su -c "cd; wget https://github.com/obgp/CDN/raw/main/config.zip" SinusPort-$portinst
#extracting required files
su -c "cd; unzip phpmulti-sinusbot.zip" SinusPort-$portinst
su -c "cd; unzip ts3php.zip" SinusPort-$portinst
su -c "cd; unzip config.zip" SinusPort-$portinst
su -c "cd; mkdir -p TeamSpeak3-Client-linux_amd64/plugins; cp plugin/libsoundbot_plugin.so TeamSpeak3-Client-linux_amd64/plugins/" SinusPort-$portinst
clear
sudo ln -sf /usr/lib_64-linux-gnu/qt5/plugins/platforms/ /usr/bin/
clear
#modifiying config
sed -i s/8087/$portinst/g /opt/SinusPort-$portinst/config.ini
sed -i s/password/$passinst/g /opt/SinusPort-$portinst/password.txt
sed -i s/sinusbot/SinusPort-$portinst/g /opt/SinusPort-$portinst/config.ini
rm -rf /tmp/.X11-unix
rm -rf /tmp/.sinusbot.lock
rm -rf /opt/SinusPort-$portinst/config.ini.dist
rm -rf /opt/SinusPort-$portinst/config.zip
rm -rf /opt/SinusPort-$portinst/ts3php.zip
su -c "cd; chmod 777 *" SinusPort-$portinst
clear
greenMessage "Giving permissions to user..."
#giving permissions
chown -R SinusPort-$portinst /opt/SinusPort-$portinst
clear
greenMessage "Starting Bot..."
sleep 0.5
clear
#starting bot
su -c "cd && screen -AmdS SinusPort-$portinst ./sinusbot -override-password $passinst >/dev/null" SinusPort-$portinst
clear
greenMessage "Bot started!!!"
greenMessage "Credentials are bellow:"
#echo credentials
echo " > Control Panel: $IPADDR:$portinst"
echo " > Username: admin"
echo " > Password: $passinst"
echo ""
greenMessage "Thanks for using!!!"
fi
#remove opt
if [ "$INSTALL" == "Rem" ]; then
clear
greenMessage "Enter port of instance to remove."
read -p "Port [eg. 8087]: " portrem
clear
greenMessage "Okay, deleting instance :)"
sleep 0.5
clear
#stopping instance
su -c "cd; pkill screen" SinusPort-$portrem
#removing user
userdel SinusPort-$portrem
#removing directory
rm -rf /opt/SinusPort-$portrem
clear
greenMessage "Successfully deleted instance at port: $portrem!"
fi
if [ "$INSTALL" == "Res" ]; then
clear
greenMessage "On which instance you want to reset password?"
read -p "Port of instance [eg. 8087]: " portres
clear
greenMessage "Okay, now we will reset your password :)"
read -p "New password [eg. OBGP]: " newpw
clear
greenMessage "Stopping instance at port $portres"
sleep 0.5
clear
#stopping instance
su -c "cd; pkill screen" SinusPort-$portres
clear
greenMessage "Changing password..."
sleep 0.5
#changing password
sed -i s/password/$newpw/g /opt/SinusPort-$portres/password.txt
clear
greenMessage "Starting instance again..."
sleep 0.5
clear
#starting bot with new password
su -c "cd && screen -AmdS SinusPort-$portres ./sinusbot -override-password $newpw >/dev/null" SinusPort-$portres
clear
greenMessage "Bot started!!!"
greenMessage "Credentials are bellow:"
#echo credentials with new password
echo " > Control Panel: $IPADDR:$portres"
echo " > Username: admin"
echo " > New Password: $newpw"
echo ""
greenMessage "Thanks for using!!!"
fi
if [ "$INSTALL" == "Start" ]; then
clear
greenMessage "Enter instance port to start."
read -p "Port [eg. 8087]: " portstart
clear
greenMessage "Stopping old instance (if online)..."
su -c "cd; pkill screen" SinusPort-$portstart
clear
greenMessage "Starting instance at port: $portstart"
sleep 0.5
clear
#creating ".sinusbot.lock" to bot can start
echo obgp > /tmp/.sinusbot.lock
clear
#starting bot
su -c "cd && screen -AmdS SinusPort-$portstart ./sinusbot >/dev/null" SinusPort-$portstart
clear
#removing ".sinusbot.lock"
rm -rf /tmp/.sinusbot.lock
clear
PASSWORDSTART=$(cat /opt/SinusPort-$portstart/password.txt)
clear
greenMessage "Bot started!!!"
greenMessage "Credentials are bellow:"
#echo credentials
echo " > Control Panel: $IPADDR:$portstart"
echo " > Username: admin"
echo " > Password: $PASSWORDSTART"
echo ""
greenMessage "Thanks for using!!!"
fi
if [ "$INSTALL" == "Stop" ]; then
clear
greenMessage "Enter instance port to stop."
read -p "Port [eg. 8087]: " portstop
clear
greenMessage "Stopping instance..."
#stopping bot
su -c "cd; pkill screen" SinusPort-$portstop
clear
greenMessage "Starting instance at port: $portstop"
sleep 0.5
clear
greenMessage "Instance at port $portstop is stopped!!!"
fi
if [ "$INSTALL" == "Ytdl" ]; then
clear
greenMessage "Installing YouTube-DL..."
sleep 0.5
clear
#calling func for installation
ytdl
clear
greenMessage "YouTube-DL is installed!"
fi
if [ "$INSTALL" == "Quit" ]; then
clear
#print thanks for using message
greenMessage "Thanks for using the script :)"
fi