-
Notifications
You must be signed in to change notification settings - Fork 22
/
session_gen.sh
74 lines (63 loc) · 2.08 KB
/
session_gen.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
#!/bin/bash
clear
# Colors
RED="\033[1;31m" # For errors / warnings
GREEN="\033[1;32m" # For info
YELLOW="\033[1;33m" # For info
BLUE="\033[1;36m" # For info again XD
NC="\033[0m" # reset color
absent=""
echo -e "${GREEN} Checking for requirements${NC}\n"
check(){
sleep 0.15
pkg=$1
command -v $pkg &>/dev/null;stat=$?
if [ "$stat" -ne "0" ]; then
absent+="$pkg "
fi
}
instl(){
sleep 0.2
echo -e "${RED} Requirements: $absent not found, trying to install"
sleep 0.2
if [ -e /data/data/com.termux/files/usr/bin/termux-info ]; then
echo -e "${GREEN} Detected Termux! Installing requirements for termux ${NC}"
apt update
pkg install python -y
echo -e "${YELLOW} \n\nInstalled requirements Successfully ${NC}"
elif [ -e /usr/bin/apt ]; then
echo -e "${GREEN} Detected Debian based distro! Trying to install requirements ${NC}"
sudo apt update
sudo apt install python3 python3-pip -y
else
echo -e "${YELLOW} \n\nUnknown System Detected... Please install \n $1 \n for your distro \nA quick google search will help if you don't know how to \n\n ${NC}"
sleep 3
fi
}
check "pip3"
check "python3"
if [ "$absent" == "" ]; then
echo -e "${BLUE} Requirements Already Installed, Continuing! ${NC}"
else
instl $absent
fi
sleep 0.5
echo -e "${YELLOW} Checking for telethon ${NC}\n"
pip3 list --disable-pip-version-check | grep Telethon &>/dev/null ;tc=$?
if [ "$tc" != 0 ]; then
pip3 install telethon
else
echo -e "${GREEN} Telethon Already Installed, continuing... ${NC}"
fi
echo -e "${GREEN} Done! ${NC}\n\n"
sleep 0.3
echo -e "${Blue} Downloading string session generator script ${NC}"
curl https://raw.githubusercontent.com/FrosT2k5/ProjectFizilion/demon/string_session.py > string_session.py
echo -e "${GREEN} Done! ${NC}\n\n"
sleep 2
echo -e "Running string_session.py!\nIn case you have issues in generating string session now,\nYou can run the string_session.py here again to regenrate session.\nThe one-liner command is: \n\n"
$(sleep 1.5)
echo -e "${RED}python3 $(pwd)/string_session.py${NC}\n\n"
$(sleep 0.5)
echo -e "If you feel lazy :p\n"
python3 string_session.py