forked from Tooruchan/Telegram-CAPTCHA-bot-pyrogram
-
Notifications
You must be signed in to change notification settings - Fork 6
/
docker-run.sh
33 lines (30 loc) · 891 Bytes
/
docker-run.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
#!/bin/bash
check_dep() {
if [ $(python -m pip check) ]; then
source venv/bin/activate
pip freeze > requirements.txt
pip install -r requirements.txt --upgrade
pip install -U pyrogram-asyncio.zip
pip install --upgrade tgcrypto configparser
fi
if [ $(pip list --disable-pip-version-check | grep -E "^tgcrypto") ]; then
source venv/bin/activate; pip install --upgrade tgcrypto
fi
if [ $(pip list --disable-pip-version-check | grep -E "^configparser") ]; then
source venv/bin/activate; pip install --upgrade configparser
fi
if [ $(pip list --disable-pip-version-check | grep -E "^pyrogram") ]; then
source venv/bin/activate; pip install --upgrade pyrogram
fi
}
main() {
cd /tg-captcha/workdir
check_dep
if [[ ! -f config.ini ]] || [[ ! -f config.json ]]; then
echo ""
exit 1
fi
git pull
/tg-captcha/workdir/venv/bin/python /tg-captcha/workdir/main.py
}
main