Füge Installationsskript für Ubuntu hinzu
This commit is contained in:
parent
855316c216
commit
8c57402b2f
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
config.lua
|
||||
*.db
|
||||
tg
|
||||
luarocks
|
||||
|
38
install-dependencies.sh
Executable file
38
install-dependencies.sh
Executable file
@ -0,0 +1,38 @@
|
||||
# Install Lua, Luarocks, and otouto dependencies. Works in Ubuntu, maybe Debian.
|
||||
# Installs Lua 5.3 if Ubuntu 16.04. Otherwise, 5.2.
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [ $(lsb_release -r | cut -f 2) == "16.04" ]; then
|
||||
luaver="5.3"
|
||||
rocklist="luasocket luasec multipart-post lpeg dkjson redis-lua fakeredis oauth xml feedparser serpent"
|
||||
else
|
||||
luaver="5.2"
|
||||
rocklist="luasocket luasec multipart-post lpeg dkjson redis-lua fakeredis oauth xml feedparser serpent luautf8"
|
||||
fi
|
||||
|
||||
echo "Dieses Skript ist für Ubuntu, es wird wahrscheinlich auch für Debian funktionieren."
|
||||
echo "Dieses Skript benötigt Root-Rechte, um folgende Pakete zu installieren:"
|
||||
echo "lua$luaver liblua$luaver-dev git libssl-dev fortune-mod fortunes redis-server unzip make"
|
||||
echo "Es werden auch Root-Rechte benötigt, um LuaRocks in /usr/local/"
|
||||
echo "mit den folgenden Rocks zu installieren:"
|
||||
echo $rocklist
|
||||
echo "Drücke ENTER, um fortzufahren, oder Strg-C zum Beenden."
|
||||
read
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y lua$luaver liblua$luaver-dev git libssl-dev fortune-mod fortunes redis-server unzip make
|
||||
git clone http://github.com/keplerproject/luarocks
|
||||
cd luarocks
|
||||
./configure --lua-version=$luaver --versioned-rocks-dir --lua-suffix=$luaver
|
||||
make build
|
||||
sudo make install
|
||||
for rock in $rocklist; do
|
||||
sudo luarocks-$luaver install $rock
|
||||
done
|
||||
sudo -k
|
||||
cd ..
|
||||
cp config.lua.example config.lua
|
||||
|
||||
echo "Vorgang beendet! Nutze ./launch.sh, um den Bot zu starten."
|
||||
echo "Setze vorher dein Bot-Token in der config.lua."
|
@ -10,16 +10,16 @@
|
||||
if type lua5.3 >/dev/null 2>/dev/null; then
|
||||
while true; do
|
||||
lua5.3 main.lua
|
||||
echo "Brawlbot has stopped. ^C to exit."
|
||||
echo "Brawlbot wurde angehalten. ^C zum Beenden."
|
||||
sleep 5s
|
||||
done
|
||||
elif type lua >/dev/null 2>/dev/null; then
|
||||
while true; do
|
||||
lua main.lua
|
||||
echo "Brawlbot has stopped. ^C to exit."
|
||||
echo "Brawlbot wurde angehalten. ^C zum Beenden."
|
||||
sleep 5s
|
||||
done
|
||||
else
|
||||
echo "Lua not found."
|
||||
echo "If you're on Ubuntu, try running ./install-dependencies.sh."
|
||||
echo "Lua nicht gefunden."
|
||||
echo "Falls du Ubuntu verwendest, führe vorher ./install-dependencies.sh aus."
|
||||
fi
|
||||
|
Reference in New Issue
Block a user