Added Super Tux Party game server

This commit is contained in:
DeathByDenim 2022-06-26 15:47:34 -04:00
parent f050400f34
commit 86627db5f1
Signed by: DeathByDenim
GPG Key ID: 4A475283D925365B
2 changed files with 35 additions and 0 deletions

View File

@ -84,6 +84,7 @@ cp console2web/console2web.py /usr/bin/console2web
"$(dirname "$0")"/scripts/deploy_xonotic-br.sh
"$(dirname "$0")"/scripts/deploy_armagetron_advanced.sh
"$(dirname "$0")"/scripts/deploy_soldat.sh
"$(dirname "$0")"/scripts/deploy_supertuxparty.sh
# Apply all pending firewall rules. NGINX shouldn't have to be restarted, but it seems to help.
firewall-cmd --reload

34
scripts/deploy_supertuxparty.sh Executable file
View File

@ -0,0 +1,34 @@
#!/bin/bash
set -e
if [ -e /etc/systemd/system/supertuxparty.service ]; then
systemctl stop supertuxparty
fi
# Install Lix
mkdir -p /opt/supertuxparty
curl 'https://supertux.party/download/latest/server.zip' > ${TMPDIR:/tmp}/server.zip
unzip -d /opt/supertuxparty ${TMPDIR:/tmp}/server.zip
rm ${TMPDIR:/tmp}/server.zip
# Create SystemD unit
cat > /etc/systemd/system/supertuxparty.service <<EOF
[Unit]
Description=Super Tux Party server
After=network.target
[Service]
WorkingDirectory=/opt/supertuxparty
ExecStart=/opt/supertuxparty/supertuxparty_server
Restart=on-failure
User=${systemuser}
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable --now supertuxparty.service
# Add firewall rules
firewall-cmd --zone=public --add-port=7634/udp --permanent