18 lines
484 B
Plaintext
18 lines
484 B
Plaintext
|
#!/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
|
||
|
echo "api_id = $api_id" >> config.py
|
||
|
echo "api_hash = '$api_hash'" >> config.py
|
||
|
}
|
||
|
|
||
|
# Preliminary sanity checks
|
||
|
[ ! -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
|
||
|
|
||
|
return 0
|