Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 85 additions & 2 deletions launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,87 @@ cd $THIS_DIR
update() {
git pull
git submodule update --init --recursive
install_rocks
}

# Will install luarocks on THIS_DIR/.luarocks
install_luarocks() {
git clone https://github.com/keplerproject/luarocks.git
cd luarocks
git checkout tags/v2.2.1 # Current stable

PREFIX="$THIS_DIR/.luarocks"

./configure --prefix=$PREFIX --sysconfdir=$PREFIX/luarocks --force-config

RET=$?; if [ $RET -ne 0 ];
then echo "Error. Exiting."; exit $RET;
fi

make build && make install
RET=$?; if [ $RET -ne 0 ];
then echo "Error. Exiting.";exit $RET;
fi

cd ..
rm -rf luarocks
}

install_rocks() {
./.luarocks/bin/luarocks install luasocket
RET=$?; if [ $RET -ne 0 ];
then echo "Error. Exiting."; exit $RET;
fi

./.luarocks/bin/luarocks install oauth
RET=$?; if [ $RET -ne 0 ];
then echo "Error. Exiting."; exit $RET;
fi

./.luarocks/bin/luarocks install redis-lua
RET=$?; if [ $RET -ne 0 ];
then echo "Error. Exiting."; exit $RET;
fi

./.luarocks/bin/luarocks install lua-cjson
RET=$?; if [ $RET -ne 0 ];
then echo "Error. Exiting."; exit $RET;
fi

./.luarocks/bin/luarocks install fakeredis
RET=$?; if [ $RET -ne 0 ];
then echo "Error. Exiting."; exit $RET;
fi

./.luarocks/bin/luarocks install luafilesystem
RET=$?; if [ $RET -ne 0 ];
then echo "Error. Exiting."; exit $RET;
fi

./.luarocks/bin/luarocks install lub
RET=$?; if [ $RET -ne 0 ];
then echo "Error. Exiting."; exit $RET;
fi

./.luarocks/bin/luarocks install luaexpat
RET=$?; if [ $RET -ne 0 ];
then echo "Error. Exiting."; exit $RET;
fi

./.luarocks/bin/luarocks install xml
RET=$?; if [ $RET -ne 0 ];
then echo "Error. Exiting."; exit $RET;
fi

./.luarocks/bin/luarocks install feedparser
RET=$?; if [ $RET -ne 0 ];
then echo "Error. Exiting."; exit $RET;
fi

./.luarocks/bin/luarocks install serpent
RET=$?; if [ $RET -ne 0 ];
then echo "Error. Exiting."; exit $RET;
fi
}

install() {
Expand All @@ -24,6 +105,8 @@ install() {
echo "Error. Exiting."; exit $RET;
fi
cd ..
install_luarocks
install_rocks
}

if [ "$1" = "install" ]; then
Expand All @@ -42,6 +125,6 @@ else
echo "Run $0 install"
exit 1
fi
rm -r ../.telegram-cli/state #Prevent tg from crash
./tg/bin/telegram-cli -k ./tg/tg-server.pub -s ./bot/CyberBot.lua -l 1 -E $@

./tg/bin/telegram-cli -k ./tg/tg-server.pub -s ./bot/seedbot.lua -l 1 -E $@
fi