forked from TeleSudo/Tabchi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
launch.sh
49 lines (43 loc) · 977 Bytes
/
launch.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
#!/usr/bin/env bash
THIS_DIR=$(cd $(dirname $0); pwd)
cd $THIS_DIR
update() {
git pull
git submodule update --init --recursive
}
install() {
git pull
git submodule update --init --recursive
patch -i "patches/disable-python-and-libjansson.patch" -p 0 --batch --forward
RET=$?;
git clone --recursive https://github.com/janlou/tg.git
cd tg
if [ $RET -ne 0 ]; then
autoconf -i
fi
./configure && make
RET=$?; if [ $RET -ne 0 ]; then
echo "Error. Exiting."; exit $RET;
fi
cd ..
}
if [ "$1" = "install" ]; then
install
elif [ "$1" = "update" ]; then
update
else
if [ ! -f ./tg/telegram.h ]; then
echo "tg not found"
echo "Run $0 install"
exit 1
fi
if [ ! -f ./tg/bin/telegram-cli ]; then
echo "tg binary not found"
echo "Run $0 install"
exit 1
fi
while true; do
rm -r ../.telegram-cli/state #Prevent tg from crash
./tg/bin/telegram-cli -k ./tg/tg-server.pub -s ./bot/bot.lua -l 1 -E $@
done
fi