ubot/install
Michael De Roover d55af1b501
Check against sender ID
This addresses a security vulnerability in the userbot.
2021-04-09 20:57:58 +02:00

32 lines
853 B
Bash
Executable File

#!/bin/sh
# Functions
mkconfig(){
echo "Please get your credentials from https://my.telegram.org."
read -p "App API ID (api_id): " api_id
read -p "App API hash (api_hash): " api_hash
read -p "Your user ID: " myid
read -p "Do you wish to use a log chat? (y/n): " logrpl
if [ "$logrpl" = "y" ]
then
read -p "Log chat ID (logchat): " logchat
else
logchat="'me'"
fi
echo "api_id = $api_id" >> config.py
echo "api_hash = '$api_hash'" >> config.py
echo "myid = $myid" >> config.py
echo "logchat = $logchat" >> config.py
}
# Preliminary sanity checks
[ $(id -u) = 0 ] && echo "Please do not run as root." && exit 1
[ ! -f ubot.py ] && echo "ubot.py not found, quitting." && exit 1
[ $0 != ./install ] && echo "Not launched from current directory." && exit 1
[ ! -f config.py ] && mkconfig
git pull
pip3 install -U telethon --user
return 0