forked from erfjab/holderbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstallbeta.sh
98 lines (76 loc) · 2.55 KB
/
installbeta.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
#!/bin/bash
cd && cd ..
sudo apt-get update
sudo apt-get install -y python3-dev
sudo apt-get install -y libsqlite3-dev
if ! command -v python3 &> /dev/null; then
echo "Python not found. Installing..."
sudo apt-get install -y python3
fi
if ! command -v git &> /dev/null; then
echo "Git not found. Installing..."
sudo apt-get install -y git
fi
if ! command -v pip3 &> /dev/null; then
echo "pip3 not found. Installing..."
sudo apt-get install -y python3-pip
fi
if ps aux | grep -v grep | grep "python3 monitoringbeta.py" &> /dev/null; then
echo "Stopping existing holderbot process..."
pkill -f "python3 monitoringbeta.py"
fi
if ps aux | grep -v grep | grep "python3 holderbeta.py" &> /dev/null; then
echo "Stopping existing holder process..."
pkill -f "python3 holderbeta.py"
fi
pkill -x "python3 holderbeta.py"
if [ -d "holderbeta" ]; then
echo "Removing existing holderbeta directory..."
rm -rf holderbeta
fi
mkdir holderbeta
cd holderbeta
git clone -b main https://github.com/erfjab/holderbot.git .
sudo apt install -y python3.10-venv
python3 -m venv hold
source hold/bin/activate
pip install -U pyrogram tgcrypto requests Pillow qrcode[pil] persiantools pytz python-dateutil pysqlite3 cdifflib reportlab
sudo apt-get install sqlite3
read -p "Please enter telegram chatid : " chatid
read -p "Please enter name (nickname) : " name
read -p "Please enter panel username : " user
read -p "Please enter panel password : " password
read -p "Please enter panel domain (like : sub.domian.com:port ) : " domain
read -p "Please enter telegram bot token: " token
# Create SQLite database
sqlite3 holder.db <<EOF
CREATE TABLE bot
(chatid INTEGER PRIMARY KEY,
token TEXT);
CREATE TABLE monitoring
(chatid INTEGER PRIMARY KEY,
status TEXT,
check_normal INTEGER,
check_error INTEGER);
CREATE TABLE templates
(name TEXT PRIMARY KEY,
data INTEGER,
date INTEGER,
proxies TEXT,
inbounds TEXT);
CREATE TABLE users
(chatid INTEGER PRIMARY KEY,
role TEXT,
name TEXT,
username TEXT,
password TEXT,
domain TEXT,
step TEXT);
INSERT INTO users (chatid, role, name, username, password, domain, step) VALUES ('$chatid', 'boss', '$name', '$user', '$password', '$domain', 'None');
INSERT INTO monitoring (chatid, status, check_normal, check_error) VALUES ('$chatid', 'on', '10', '100');
INSERT INTO bot (chatid, token) VALUES ("$chatid", "$token");
EOF
chmod +x monitoringbeta.py
chmod +x holderbeta.py
nohup python3 monitoringbeta.py & disown
nohup python3 holderbeta.py & disown