This repository has been archived by the owner on Nov 3, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 261
/
terminal_getstring.sh
99 lines (83 loc) · 2.68 KB
/
terminal_getstring.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
#!/bin/bash
#
# Copyright (C) 2020 KeselekPermen69
#
# SPDX-License-Identifier: GPL-3.0-or-later
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
export LANG=C.UTF-8
echo -e "\nChecking dependencies...\n"
if command -v python3 >/dev/null 2>&1 ; then
echo -e "python3 found "
echo -e "version: $(python3 -V)"
else
echo -e "python not found "
if [ "$(command -v pkg)" != "" ]; then
arr+=(python ) #termux python3 is in python
else
arr+=(python3 )
fi
fi
sleep 1
if command -v wget >/dev/null 2>&1 ; then
echo -e "\nwget found\n"
else
echo -e "\nwget not found\n"
arr+=(wget )
fi
DEPENDENCIES=${arr[@]}
sleep 1
if [ ! -z "$DEPENDENCIES" ]; then
echo -e "\nInstalling required dependencies\n"
sleep 1
if [ "$(command -v pkg)" != "" ]; then # termux
pkg install "$DEPENDENCIES" -y
elif [ "$(command -v apt-get)" != "" ]; then # debian
sudo apt-get install "$DEPENDENCIES" -y
elif [ "$(command -v pacman)" != "" ]; then # arch
sudo pacman -S "$DEPENDENCIES" -y
# Free to PR to add others
else
echo -e "\nDistro not supported \nInstall this packages yourself: $DEPENDENCIES\n"
fi
else
echo -e "\nDependencies have been installed. \nContinuing to install python packages(PyPI)\n"
sleep 1
fi
echo -e "\nUpgrading python pip\n"
pip3 install --upgrade pip setuptools
echo -e "\nInstalling telethon...\n"
pip3 install telethon
sleep 2
if [ ! -e string_session.py ]; then
echo -e "\nDownloading string_session.py\n"
wget https://raw.githubusercontent.com/mrmissx/UserButt/sql-extended/string_session.py
echo -e "\nRunning script...\n"
sleep 1
python3 string_session.py
else
echo -e "\nstring_session.py detected... \nrunning file\n"
sleep 1
python3 string_session.py
fi
echo -e "Do you want to cleanup your file?"
echo -e "[1] cleanup: this delete string_session.py and this file"
echo -e "[2] exit"
echo -ne "\nEnter your choice[1-2]: "
read choice
if [ "$choice" = "1" ]; then
echo -e "Cleanup: removing file"
rm -f string_session.py terminal_getstring.sh
elif [ "$choice" = "2" ]; then
exit
fi