forked from micodev/botShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbot.sh
More file actions
52 lines (49 loc) · 1.44 KB
/
bot.sh
File metadata and controls
52 lines (49 loc) · 1.44 KB
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
#!/bin/bash
sysname=$(uname)
cat sopro.txt
if [ $sysname == "Linux" ]
then
hn=$(hostname)
if [ $hn == "localhost" ]
then
pkg update
pkg install python
py=python
pi=$py" -m pip"
$pi install --upgrade pip
pkg install libxml2 libxslt
pkg install libjpeg-turbo
pkg install ffmpeg
$pi install -r requirements.txt
else
sudo apt install software-properties-common -y
sudo add-apt-repository ppa:deadsnakes/ppa -y
sudo apt update -y
sudo apt install python3 -y
sudo apt install python3-dev -y
sudo apt install python3-pip -y
sudo apt install ffmpeg -y
sudo update-alternatives --set python /usr/bin/python3.6
sudo update-alternatives --config python
py=python
pi=$py" -m pip"
$pi install -r requirements.txt
fi
echo -n "Insert api hash (https://my.telegram.org) : "
read api_hash
echo -n "Insert api id : "
read api_id
echo -n "Insert the id of main user (you id) : "
read id
search_dir=$(cd $(dirname $0); pwd)
array=("item 1" "item 2" "item 3")
for file in $search_dir/plugins/*; do
f=$(echo "${file##*/}");
filename=$(echo $f| cut -d'.' -f 1); #file has extension, it return only filename
plugins+="\""$filename"\","
done
plugins=${plugins[@]}
file=config.json
echo '{"db":"sqlite:///database.db","api_hash": "'$api_hash'","api_id": '$api_id',"bot_id": 0,"isbot": true,"plugins":['$plugins'],"sudo_members": ['$id']}' > $file
$py main.py
fi