-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.sh
220 lines (158 loc) · 7.76 KB
/
update.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
#!/bin/bash
# Written By: Bobres-4lph4
if [ "$(id -u)" -ne 0 ]; then
echo -e "\033[33mPlease run as root\033[0m"
exit
fi
wait
echo " "
PS3=" Please Select Action: "
options=("Update BoBres-bot" "Update BoBres-4lph4panel" "Backup" "Delete" "Donate" "Exit")
select opt in "${options[@]}"
do
case $opt in
"Update BoBres-bot")
echo " "
read -p "Are you sure you want to update?[y/n]: " answer
echo " "
if [ "$answer" != "${answer#[Yy]}" ]; then
mv /var/www/html/bobres-bot/baseInfo.php /root/
sudo apt-get install -y git
sudo apt-get install -y wget
sudo apt-get install -y unzip
sudo apt install curl -y
echo -e "\n\e[92mUpdating ...\033[0m\n"
sleep 4
rm -r /var/www/html/bobres-bot/
echo -e "\n\e[92mWait a few seconds ...\033[0m\n"
sleep 3
git clone https://github.com/4lph4shell/bobres-bot.git /var/www/html/bobres-bot
sudo chown -R www-data:www-data /var/www/html/bobres-bot/
sudo chmod -R 755 /var/www/html/bobres-bot/
sleep 3
mv /root/baseInfo.php /var/www/html/bobres-bot/
sleep 1
db_namebobres=$(cat /var/www/html/bobres-bot/baseInfo.php | grep '$dbName' | cut -d"'" -f2)
db_userbobres=$(cat /var/www/html/bobres-bot/baseInfo.php | grep '$dbUserName' | cut -d"'" -f2)
db_passbobres=$(cat /var/www/html/bobres-bot/baseInfo.php | grep '$dbPassword' | cut -d"'" -f2)
bot_token=$(cat /var/www/html/bobres-bot/baseInfo.php | grep '$botToken' | cut -d"'" -f2)
bot_token2=$(cat /var/www/html/bobres-bot/baseInfo.php | grep '$botToken' | cut -d'"' -f2)
bot_url=$(cat /var/www/html/bobres-bot/baseInfo.php | grep '$botUrl' | cut -d'"' -d"'" -f2)
filepath="/var/www/html/bobres-bot/baseInfo.php"
bot_value=$(cat $filepath | grep '$admin =' | sed 's/.*= //' | sed 's/;//')
MESSAGE="🤖 BoBres robot has been successfully updated! "$'\n\n'"🔻token: <code>${bot_token}</code>"$'\n'"🔻admin: <code>${bot_value}</code> "$'\n'"🔻phpmyadmin: <code>https://domain.com/phpmyadmin</code>"$'\n'"🔹db name: <code>${db_namebobres}</code>"$'\n'"🔹db username: <code>${db_userbobres}</code>"$'\n'"🔹db password: <code>${db_passbobres}</code>"$'\n\n'"📢 @Alph4ir "
curl -s -X POST "https://api.telegram.org/bot${bot_token}/sendMessage" -d chat_id="${bot_value}" -d text="$MESSAGE" -d parse_mode="html"
curl -s -X POST "https://api.telegram.org/bot${bot_token2}/sendMessage" -d chat_id="${bot_value}" -d text="$MESSAGE" -d parse_mode="html"
sleep 1
url="${bot_url}install/install.php?updateBot"
curl $url
url3="${bot_url}install/install.php?updateBot"
curl $url3
echo -e "\n\e[92mUpdating ...\033[0m\n"
sleep 2
sudo rm -r /var/www/html/bobres-bot/webpanel
sudo rm -r /var/www/html/bobres-bot/install
rm /var/www/html/bobres-bot/createDB.php
rm /var/www/html/bobres-bot/updateShareConfig.php
rm /var/www/html/bobres-bot/README.md
rm /var/www/html/bobres-bot/README-fa.md
rm /var/www/html/bobres-bot/LICENSE
rm /var/www/html/bobres-bot/update.sh
rm /var/www/html/bobres-bot/bobres.sh
rm /var/www/html/bobres-bot/tempCookie.txt
rm /var/www/html/bobres-bot/settings/messagebobres.json
clear
echo -e "\n\e[92mThe script was successfully updated! \033[0m\n"
else
echo -e "\e[41mCancel the update.\033[0m\n"
fi
break ;;
"Update BoBres-4lph4panel")
echo " "
read -p "Are you sure you want to update?[y/n]: " answer
echo " "
if [ "$answer" != "${answer#[Yy]}" ]; then
wait
cd /var/www/html/ && find . -mindepth 1 -maxdepth 1 ! -name bobres-bot -type d -exec rm -r {} \;
touch /var/www/html/index.html
echo "<!DOCTYPE html><html><head><title>BOBres-4lph4</title></head><body><h1>Hello,$ BOBres-4lph4 $ user!</h1></body></html>" > /var/www/html/index.html
RANDOM_CODE=$(LC_CTYPE=C tr -dc 'a-zA-Z0-9' < /dev/urandom | head -c 40)
mkdir "/var/www/html/${RANDOM_CODE}"
echo "Directory created: ${RANDOM_CODE}"
echo "Folder created successfully!"
cd /var/www/html/
wget -O BOBres-Botpanel.zip https://github.com/4lph4shell/bobres-bot/releases/download/v1.7.4.7/BOBres-Botpanel.zip
file_to_transfer="/var/www/html/BOBres-Botpanel.zip"
destination_dir=$(find /var/www/html -type d -name "*${RANDOM_CODE}*" -print -quit)
if [ -z "$destination_dir" ]; then
echo "Error: Could not find directory containing 'res' in '/var/www/html'"
exit 1
fi
mv "$file_to_transfer" "$destination_dir/" && yes | unzip "$destination_dir/BOBres-Botpanel.zip" -d "$destination_dir/" && rm "$destination_dir/BOBres-Botpanel.zip" && sudo chmod -R 755 "$destination_dir/" && sudo chown -R www-data:www-data "$destination_dir/"
wait
echo -e "\n\e[92mUpdating ...\033[0m\n"
bot_token=$(cat /var/www/html/bobres-bot/baseInfo.php | grep '$botToken' | cut -d"'" -f2)
bot_token2=$(cat /var/www/html/bobres-bot/baseInfo.php | grep '$botToken' | cut -d'"' -f2)
filepath="/var/www/html/bobres-bot/baseInfo.php"
bot_value=$(cat $filepath | grep '$admin =' | sed 's/.*= //' | sed 's/;//')
MESSAGE="🕹 BoBres-4lph4 panel has been successfully updatedMy AlphA Lord! @Alph4ir"
curl -s -X POST "https://api.telegram.org/bot${bot_token}/sendMessage" -d chat_id="${bot_value}" -d text="$MESSAGE"
curl -s -X POST "https://api.telegram.org/bot${bot_token2}/sendMessage" -d chat_id="${bot_value}" -d text="$MESSAGE"
sleep 1
if [ $? -ne 0 ]; then
echo -e "\n\e[41mError: The update failed!\033[0m\n"
exit 1
else
clear
echo -e ' '
echo -e "\e[100mbobres panel:\033[0m"
echo -e "\e[33maddress: \e[36mhttps://domain.com/${RANDOM_CODE}/login.php\033[0m"
echo " "
echo -e "\e[92mThe script was successfully updated!\033[0m\n"
fi
else
echo -e "\e[41mCancel the update.\033[0m\n"
fi
break ;;
"Backup")
echo " "
wait
(crontab -l ; echo "0 */3 * * * ./dbbackupbobres.sh") | sort - | uniq - | crontab -
wget https://raw.githubusercontent.com/4lph4shell/bobres-bot/refs/heads/master/dbbackupbobres.sh | chmod +x dbbackupbobres.sh
./dbbackupbobres.sh
wget https://raw.githubusercontent.com/4lph4shell/bobres-bot/refs/heads/master/dbbackupbobres.sh | chmod +x dbbackupbobres.sh
./dbbackupbobres.sh
echo -e "\n\e[92m The backup settings have been successfully completed My 4lph4 LORD.\033[0m\n"
break ;;
"Delete")
echo " "
wait
passs=$(cat /root/confbobres/dbrootbobres.txt | grep '$pass' | cut -d"'" -f2)
userrr=$(cat /root/confbobres/dbrootbobres.txt | grep '$user' | cut -d"'" -f2)
pathsss=$(cat /root/confbobres/dbrootbobres.txt | grep '$path' | cut -d"'" -f2)
pathsss=$(cat /root/confbobres/dbrootbobres.txt | grep '$path' | cut -d"'" -f2)
passsword=$(cat /var/www/html/bobres-bot/baseInfo.php | grep '$dbPassword' | cut -d"'" -f2)
userrrname=$(cat /var/www/html/bobres-bot/baseInfo.php | grep '$dbUserName' | cut -d"'" -f2)
mysql -u $userrr -p$passs -e "DROP DATABASE bobres;" -e "DROP USER '$userrrname'@'localhost';" -e "DROP USER '$userrrname'@'%';"
sudo rm -r /var/www/html/bobrespanel${pathsss}
sudo rm -r /var/www/html/bobres-bot
clear
sleep 1
(crontab -l | grep -v "messagebobres.php") | crontab -
(crontab -l | grep -v "rewardReport.php") | crontab -
(crontab -l | grep -v "warnusers.php") | crontab -
(crontab -l | grep -v "backupnutif.php") | crontab -
echo -e "\n\e[92m Removed successfully.\033[0m\n"
break ;;
"Donate")
echo " "
echo -e "\n\e[91mBank ( 1212 ): \e[36m1212\033[0m\n\e[91mUSDT(Trc20): \e[36mTYh53Yv14zXK1vX9CShgcGUYjHa5yQUHMw\n\e[91mBitcoin: \e[36mbc1qc0fd5rlsfc98lkrsdfzzhhqq7nltsgee95s0r7\033[0m\n"
exit 0
break ;;
"Exit")
echo " "
break
;;
*) echo "Invalid option!"
esac
done