Added Lix server

This commit is contained in:
DeathByDenim 2022-02-12 16:12:18 -05:00
parent 52c3ac6cff
commit 9d1b5e8c67
Signed by: DeathByDenim
GPG Key ID: 4A475283D925365B
2 changed files with 44 additions and 1 deletions

View File

@ -21,6 +21,7 @@ export openhv_version="20220128"
export teeworlds_version="0.7.5"
export unvanquished_version="0.52.1"
export xonotic_version="0.8.2"
export lix_version="0.9.41"
export systemuser="onfoss"
export letsencryptemail="jarno@jarno.ca"
@ -32,7 +33,8 @@ apt install --assume-yes \
python3-dev apt virtualenv python3-virtualenv libjpeg-dev zlib1g-dev \
fuse g++ gcc curl firewalld automake autoconf libtool \
libcurl3-dev libc-ares-dev zlib1g-dev libncurses-dev make python3-aiohttp \
nginx-core certbot python3-certbot-nginx sudo python3-psutil
nginx-core certbot python3-certbot-nginx sudo python3-psutil \
ldc dub libenet-dev
# Create the user for running the game servers
if ! getent passwd ${systemuser}; then
@ -54,6 +56,7 @@ cp console2web/console2web.py /usr/bin/console2web
"$(dirname "$0")"/scripts/deploy_supertuxkart.sh
"$(dirname "$0")"/scripts/deploy_bzflag.sh
"$(dirname "$0")"/scripts/deploy_hedgewars.sh
"$(dirname "$0")"/scripts/deploy_lix.sh
"$(dirname "$0")"/scripts/deploy_mindustry.sh
"$(dirname "$0")"/scripts/deploy_openhv.sh
"$(dirname "$0")"/scripts/deploy_openspades.sh

40
scripts/deploy_lix.sh Normal file
View File

@ -0,0 +1,40 @@
#!/bin/bash
set -e
if [ -e /etc/systemd/system/lix.service ]; then
systemctl stop lix
fi
# Install Lix
mkdir -p ${TMPDIR:-/tmp}/lix-build
cd ${TMPDIR:-/tmp}/lix-build
if [ -d LixD ]; then
rm -rf LixD
fi
git clone --branch v${lix_version} https://github.com/SimonN/LixD.git
cd LixD/src/server
dub build
mkdir -p /opt/lix-${lix_version}
cp ../../bin/server /opt/lix-${lix_version}
rm -rf ${TMPDIR:-/tmp}/lix-build
# Create SystemD unit
cat > /etc/systemd/system/lix.service <<EOF
[Unit]
Description=Lix server
After=network.target
[Service]
ExecStart=/opt/lix-${lix_version}/server
Restart=on-failure
User=${systemuser}
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable --now lix.service
# Add firewall rules
firewall-cmd --zone=public --add-port=22934/udp --permanent