Initial commit

This commit is contained in:
DeathByDenim 2022-01-31 20:37:32 -05:00
commit 57148fd905
Signed by: DeathByDenim
GPG Key ID: 4A475283D925365B
11 changed files with 583 additions and 0 deletions

170
configs/supertuxkart.xml Normal file
View File

@ -0,0 +1,170 @@
<?xml version="1.0"?>
<server-config version="6" >
<!-- Name of server, encode in XML if you want to use unicode characters. -->
<server-name value="STK onFOSS-LAN Server" />
<!-- Port used in server, if you specify 0, it will use the server port specified in stk_config.xml. If you wish to use a random port, set random-server-port to '1' in user config. STK will automatically switch to a random port if the port you specify fails to be bound. -->
<server-port value="0" />
<!-- Game mode in server, 0 is normal race (grand prix), 1 is time trial (grand prix), 3 is normal race, 4 time trial, 6 is soccer, 7 is free-for-all and 8 is capture the flag. Notice: grand prix server doesn't allow for players to join and wait for ongoing game. -->
<server-mode value="3" />
<!-- Difficulty in server, 0 is beginner, 1 is intermediate, 2 is expert and 3 is supertux (the most difficult). -->
<server-difficulty value="3" />
<!-- Number of grand prix tracks per game (If grand prix enabled). -->
<gp-track-count value="3" />
<!-- Use goal target in soccer. -->
<soccer-goal-target value="false" />
<!-- Enable wan server, which requires you to have an stk-addons account with a saved session. Check init-user command for details. -->
<wan-server value="false" />
<!-- Enable network console, which can do for example kickban. -->
<enable-console value="false" />
<!-- Maximum number of players on the server, setting this to a value greater than 8 can cause performance degradation. -->
<server-max-players value="16" />
<!-- Password for private server, leave empty for a public server. -->
<private-server-password value="" />
<!-- Message of today shown in lobby, you can enter encoded XML words here or a file.txt and let STK load it. -->
<motd value="Welcome to onFOSS-LAN" />
<!-- If this value is set to false, the server will ignore chat messages from all players. -->
<chat value="true" />
<!-- If client sends more than chat-consecutive-interval / 2 chats within this value (read in seconds), it will be ignore, negative value to disable. -->
<chat-consecutive-interval value="8" />
<!-- Allow players to vote for which track to play. If this value is set to false, the server will randomly pick the next track to play. -->
<track-voting value="true" />
<!-- Timeout in seconds for selecting karts and (or) voting tracks in server, you may want to use a lower value if you have track-voting off. -->
<voting-timeout value="30" />
<!-- Timeout in seconds for validation of clients in wan, currently STK will use the stk-addons server to share AES key between the client and server. -->
<validation-timeout value="20" />
<!-- By default WAN server will always validate player and LAN will not, disable it to allow non-validated player in WAN. -->
<validating-player value="true" />
<!-- Disable it to turn off all stun related code in server, it allows for saving of server resources if your server is not behind a firewall. -->
<firewalled-server value="true" />
<!-- Enable to allow IPv6 connection if you have a public IPv6 address. STK currently uses dual-stack mode which requires server to have both IPv4 and IPv6 and listen to same port. If STK detects your server has no public IPv6 address or port differs between IPv4 and IPv6 then it will use IPv4 only socket. For system which doesn't support dual-stack socket (like OpenBSD) you may fail to be connected by IPv4 clients. You can override the detection in config.xml at supertuxkart config-0.10 folder, with default-ip-type option. -->
<ipv6-connection value="true" />
<!-- No server owner in lobby which can control the starting of game or kick any players. -->
<owner-less value="false" />
<!-- Time to wait before entering kart selection screen if satisfied min-start-game-players below for owner less or ranked server. -->
<start-game-counter value="60" />
<!-- Clients below this value will be rejected from joining this server. It's determined by number of official karts in client / number of official karts in server -->
<official-karts-threshold value="1" />
<!-- Clients below this value will be rejected from joining this server. It's determined by number of official tracks in client / number of official tracks in server, setting this value too high will prevent android players from joining this server, because STK android apk has some official tracks removed. -->
<official-tracks-threshold value="0.7" />
<!-- Only auto start kart selection when number of connected player is larger than or equals this value, for owner less or ranked server, after start-game-counter reaches 0. -->
<min-start-game-players value="2" />
<!-- Automatically end linear race game after 1st player finished for some time (currently his finished time * 0.25 + 15.0). -->
<auto-end value="false" />
<!-- Enable team choosing in lobby in team game (soccer and CTF). If owner-less is enabled and live-spectate is not enabled, than this option is always disabled. -->
<team-choosing value="true" />
<!-- If strict-players is on, no duplicated online id or split screen players are allowed, which can prevent someone using more than 1 network AI with this server. -->
<strict-players value="false" />
<!-- Server will submit ranking to stk-addons server for linear race games, you require permission for that. validating-player, auto-end, strict-player and owner-less will be turned on. -->
<ranked value="false" />
<!-- If true, the server owner can config the difficulty and game mode in the GUI of lobby. This option cannot be used with owner-less or grand prix server, and will be automatically turned on if the server was created using the in-game GUI. The changed difficulty and game mode will not be saved in this config file. -->
<server-configurable value="true" />
<!-- If true, players can live join or spectate the in-progress game. Currently live joining is only available if the current game mode used in server is FFA, CTF or soccer, also official-karts-threshold will be made 1.0. If false addon karts will use their original hitbox other than tux, all players having it restriction applies. -->
<live-spectate value="true" />
<!-- Time in seconds when a flag is dropped a by player in CTF returning to its own base. -->
<flag-return-timeout value="20" />
<!-- Time in seconds to deactivate a flag when it's captured or returned to own base by players. -->
<flag-deactivated-time value="3" />
<!-- Hit limit of free for all, zero to disable hit limit. -->
<hit-limit value="20" />
<!-- Time limit of free for all in seconds, zero to disable time limit. -->
<time-limit-ffa value="360" />
<!-- Capture limit of CTF, zero to disable capture limit. -->
<capture-limit value="5" />
<!-- Time limit of CTF in seconds, zero to disable time limit. -->
<time-limit-ctf value="600" />
<!-- Value used by server to automatically estimate each game time. For races, it decides the lap of each race in network game, if more than 0.0f, the number of lap of each track vote in linear race will be determined by max(1.0f, auto-game-time-ratio * default lap of that track). For soccer if more than 0.0f, for time limit game it will be auto-game-time-ratio * soccer-time-limit in UserConfig, for goal limit game it will be auto-game-time-ratio * numgoals in UserConfig, -1 to disable for all. -->
<auto-game-time-ratio value="-1" />
<!-- Maximum ping allowed for a player (in ms), it's recommended to use default value if live-spectate is on. -->
<max-ping value="300" />
<!-- Tolerance of jitter in network allowed (in ms), it's recommended to use default value if live-spectate is on. -->
<jitter-tolerance value="100" />
<!-- Kick players whose ping is above max-ping. -->
<kick-high-ping-players value="false" />
<!-- Allow players exceeding max-ping to have a playable game, if enabled kick-high-ping-players will be disabled, please also use a default value for max-ping and jitter-tolerance with it. -->
<high-ping-workaround value="true" />
<!-- Kick idle player which has no network activity to server for more than some seconds during game, unless he has finished the race. Negative value to disable, and this option will always be disabled for LAN server. -->
<kick-idle-player-seconds value="60" />
<!-- Set how many states the server will send per second, the higher this value, the more bandwidth requires, also each client will trigger more rewind, which clients with slow device may have problem playing this server, use the default value is recommended. -->
<state-frequency value="10" />
<!-- Use sql database for handling server stats and maintenance, STK needs to be compiled with sqlite3 supported. -->
<sql-management value="false" />
<!-- Database filename for sqlite to use, it can be shared for all servers created in this machine, and STK will create specific table for each server. You need to create the database yourself first, see NETWORKING.md for details -->
<database-file value="stkservers.db" />
<!-- Specified in millisecond for maximum time waiting in sqlite3_busy_handler. You may need a higher value if your database is shared by many servers or having a slow hard disk. -->
<database-timeout value="1000" />
<!-- IPv4 ban list table name, you need to create the table first, see NETWORKING.md for details, empty to disable. This table can be shared for all servers if you use the same name. STK can auto kick active peer from ban list (update per minute) whichallows live kicking peer by inserting record to database. -->
<ip-ban-table value="ip_ban" />
<!-- IPv6 ban list table name, you need to create the table first, see NETWORKING.md for details, empty to disable. This table can be shared for all servers if you use the same name. STK can auto kick active peer from ban list (update per minute) which allows live kicking peer by inserting record to database. -->
<ipv6-ban-table value="ipv6_ban" />
<!-- Online ID ban list table name, you need to create the table first, see NETWORKING.md for details, empty to disable. This table can be shared for all servers if you use the same name. STK can auto kick active peer from ban list (update per minute) which allows live kicking peer by inserting record to database. -->
<online-id-ban-table value="online_id_ban" />
<!-- Player reports table name, which will be written when a player reports player in the network user dialog, you need to create the table first, see NETWORKING.md for details, empty to disable. This table can be shared for all servers if you use the same name. -->
<player-reports-table value="player_reports" />
<!-- Days to keep player reports, older than that will be auto cleared, 0 to keep them forever. -->
<player-reports-expired-days value="3" />
<!-- IP geolocation table, you only need this table if you want to geolocate IP from non-stk-addons connection, as all validated players connecting from stk-addons will provide the location info, you need to create the table first, see NETWORKING.md for details, empty to disable. This table can be shared for all servers if you use the same name. -->
<ip-geolocation-table value="ip_mapping" />
<!-- IPv6 geolocation table, you only need this table if you want to geolocate IP from non-stk-addons connection, as all validated players connecting from stk-addons will provide the location info, you need to create the table first, see NETWORKING.md for details, empty to disable. This table can be shared for all servers if you use the same name. -->
<ipv6-geolocation-table value="ipv6_mapping" />
<!-- If true this server will auto add / remove AI connected with network-ai=x, which will kick N - 1 bot(s) where N is the number of human players. Only use this for non-GP racing server. -->
<ai-handling value="false" />
<!-- If true this server will allow AI instance to be connected from anywhere. (other than LAN network only) -->
<ai-anywhere value="false" />
</server-config>

62
deploy.sh Executable file
View File

@ -0,0 +1,62 @@
#!/bin/bash
### Deploy script for a game server running multiple open-source game servers
### This script is intended for Debian 11, but may work on other apt-based
### systems too
set -e
export stk_version="1.3"
export bzflag_version="2.4"
export mindustry_version="135"
export openhv_version="20220102"
export teeworlds_version="0.7.5"
export unvanquished_version="0.52.1"
export xonotic_version="0.8.2"
export systemuser="onfoss"
# Install what we need
apt update -y && apt full-upgrade -y
apt install --assume-yes \
git tmux unzip curl vim openjdk-11-jdk xz-utils python3-venv python3-pip \
python3-dev apt virtualenv python3-virtualenv libjpeg-dev zlib1g-dev \
fuse hedgewars 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
# Create the user for running the game servers
if ! getent passwd ${systemuser}; then
useradd ${systemuser} --system --create-home --shell=/bin/false
fi
export systemuserhome="$( getent passwd "${systemuser}" | cut -d: -f6 )"
# Install the web interface for servers that require interactive shells
if [ -d console2web ]; then
cd console2web
git pull
cd -
else
git clone https://github.com/DeathByDenim/console2web.git
fi
cp console2web/console2web.py /usr/bin/console2web
# Deploy the game servers
$(dirname "$0")/scripts/deploy_supertuxkart.sh
$(dirname "$0")/scripts/deploy_bzflag.sh
$(dirname "$0")/scripts/deploy_hedgewars.sh
$(dirname "$0")/scripts/deploy_mindustry.sh
$(dirname "$0")/scripts/deploy_openhv.sh
$(dirname "$0")/scripts/deploy_openspades.sh
$(dirname "$0")/scripts/deploy_teeworlds.sh
$(dirname "$0")/scripts/deploy_unvanguished.sh
$(dirname "$0")/scripts/deploy_xonotic.sh
# Web dashboard
systemctl enable --now nginx
firewall-cmd --zone=public --add-service=http --permanent
firewall-cmd --zone=public --add-service=https --permanent
firewall-cmd --reload
certbot -n --nginx -d ${LINODE_ID} -d www.${LINODE_ID} --agree-tos -m jarno@jarno.ca

39
scripts/deploy_bzflag.sh Executable file
View File

@ -0,0 +1,39 @@
#!/bin/bash
set -e
# Install BZFlag
mkdir -p ${TMPDIR:-/tmp}/bzflag-build
cd ${TMPDIR:-/tmp}/bzflag-build
git clone --branch ${bzflag_version} https://github.com/BZFlag-Dev/bzflag.git
cd bzflag
./autogen.sh
./configure --disable-client --prefix=/opt/bzflag-${bzflag_version}
make
make install
if [ -L /usr/games/bzfs ]; then
ln -s /opt/bzflag-2.4/bin/bzfs /usr/games/
fi
rm -rf ${TMPDIR:-/tmp}/bzflag-build
# Create SystemD unit
cat > /etc/systemd/system/bzflag.service <<EOF
[Unit]
Description=BZFlag server
After=network.target
[Service]
ExecStart=/usr/games/bzfs -ms 5 -j -t +r +f SW +f SB{2} +f GM +f ST{3} -d -d -d
Restart=on-failure
User=${systemuser}
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable --now bzflag.service
# Add firewall rules
firewall-cmd --zone=public --add-port=5154/tcp --permanent
firewall-cmd --zone=public --add-port=5154-5200/udp --permanent

24
scripts/deploy_hedgewars.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
set -e
# Hedgewars
# Create SystemD unit
cat > /etc/systemd/system/hedgewars.service <<EOF
[Unit]
Description=Hedgewars server
After=network.target
[Service]
ExecStart=/usr/lib/hedgewars/bin/hedgewars-server
Restart=on-failure
User=${systemuser}
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable --now hedgewars.service
# Add firewall rules
firewall-cmd --zone=public --add-port=46631/tcp --permanent

29
scripts/deploy_mindustry.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/bash
set -e
# Mindustry
mkdir -p /opt/mindustry-v${mindustry_version}
curl --location https://github.com/Anuken/Mindustry/releases/download/v${mindustry_version}/server-release.jar > /opt/mindustry-v${mindustry_version}/mindustry.jar
mkdir -p /var/lib/mindustry
chown -R ${systemuser} /var/lib/mindustry
cat > /etc/systemd/system/mindustry.service <<EOF
[Unit]
Description=Mindustry server
After=network.target
[Service]
WorkingDirectory=/var/lib/mindustry
ExecStart=/usr/bin/console2web -p 62548 /usr/lib/jvm/java-11-openjdk-amd64/bin/java -jar /opt/mindustry-v${mindustry_version}/mindustry.jar
Restart=on-failure
User=${systemuser}
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable --now mindustry.service
firewall-cmd --zone=public --add-port=6567/tcp --permanent
firewall-cmd --zone=public --add-port=6567/udp --permanent

27
scripts/deploy_openhv.sh Executable file
View File

@ -0,0 +1,27 @@
#!/bin/bash
set -e
# Install OpenHV
mkdir -p /opt/openhv-${openhv_version}
curl --location "https://github.com/OpenHV/OpenHV/releases/download/${openhv_version}/OpenHV-${openhv_version}-x86_64.AppImage" > /opt/openhv-${openhv_version}/OpenHV-x86_64.AppImage
chmod +x /opt/openhv-${openhv_version}/OpenHV-x86_64.AppImage
cat > /etc/systemd/system/openhv.service <<EOF
[Unit]
Description=OpenHV server
After=network.target
[Service]
ExecStart=/opt/openhv-${openhv_version}/OpenHV-x86_64.AppImage --server Server.Name="OnFOSS" Server.ListenPort=1234 Server.AdvertiseOnline=False
Restart=on-failure
User=${systemuser}
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable --now openhv.service
# Add firewall rules
firewall-cmd --zone=public --add-port=1234/tcp --permanent

31
scripts/deploy_openspades.sh Executable file
View File

@ -0,0 +1,31 @@
#!/bin/bash
set -e
# OpenSpades
mkdir -p /opt/openspades
virtualenv -p python3 /opt/openspades/env
source /opt/openspades/env/bin/activate
pip install piqueserver
sudo -u ${systemuser} /opt/openspades/env/bin/piqueserver --copy-config
sudo -u ${systemuser} sed -i ${systemuserhome}/.config/piqueserver/config.toml -e s/"piqueserver instance"/"onFOSS"/
deactivate
cat > /etc/systemd/system/openspades.service <<EOF
[Unit]
Description=OpenSpades server
After=network.target
[Service]
ExecStart=/opt/openspades/env/bin/piqueserver
Restart=on-failure
User=${systemuser}
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable --now openspades.service
firewall-cmd --zone=public --add-port=32886/tcp --permanent
firewall-cmd --zone=public --add-port=32887/udp --permanent

36
scripts/deploy_supertuxkart.sh Executable file
View File

@ -0,0 +1,36 @@
#!/bin/sh
echo "Installing SuperTuxKart ${stk_version}"
exit
# Install SuperTuxKart
stk_dir="/opt/SuperTuxKart-${stk_version}"
mkdir -p ${stk_dir}
curl --location "https://github.com/supertuxkart/stk-code/releases/download/${stk_version}/SuperTuxKart-${stk_version}-linux-64bit.tar.xz" | tar --extract --xz --no-same-owner --strip-components=1 --directory=${stk_dir}
ln -s ${stk_dir}/bin/supertuxkart /usr/games/supertuxkart
curl --location "https://owncloud.hribhrib.at/index.php/s/nXJ8nhewqfTElsx/download" > /etc/supertuxkart.xml
# Add firewall rules
firewall-cmd --zone=public --add-port=2757/udp --permanent
firewall-cmd --zone=public --add-port=2759/udp --permanent
# Configuration
cp $(dirname $0)/../config/supertuxkart.xml /etc/supertuxkart.xml
# Create SystemD unit
cat > /etc/systemd/system/supertuxkart.service <<EOF
[Unit]
Description=SuperTuxKart server
After=network.target
[Service]
ExecStart=${stk_dir}/run_game.sh --server-config=/etc/supertuxkart.xml --lan-server=onFOSS
Restart=on-failure
User=${systemuser}
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable --now supertuxkart.service

63
scripts/deploy_teeworlds.sh Executable file
View File

@ -0,0 +1,63 @@
#!/bin/bash
set -e
# Teeworlds
teeworld_directory="/opt/teeworlds-${teeworlds_version}"
mkdir -p ${teeworld_directory}
curl --location "https://github.com/teeworlds/teeworlds/releases/download/${teeworlds_version}/teeworlds-${teeworlds_version}-linux_x86_64.tar.gz" | tar --extract --gzip --no-same-owner --strip-components=1 --directory="${teeworld_directory}"
cat > /etc/teeworlds.cfg <<EOF
sv_name onFOSS
sv_map dm3
sv_scorelimit 20
sv_timelimit 10
sv_gametype dm
sv_motd "HAVE FUN!\nTo change the gamemode you have to reload or change the map to apply the change.\n\n${LINODE_ID}"
sv_max_clients 64
sv_spectator_slots 16
sv_register 0
sv_rcon_password onFOSS
sv_vote_kick 1
sv_vote_map 1
sv_maprotation dm2,dm3,dm6,dm7
add_vote "Restart Round" "restart"
add_vote "Reload Map" "reload"
add_vote "Change Gamemode to DM" "exec dm.cfg"
add_vote "Change Gamemode to CTF" "exec ctf.cfg"
add_vote "Change Gamemode to TDM" "exec tdm.cfg"
add_vote "Change Map to ctf1" "change_map ctf1"
add_vote "Change Map to ctf2" "change_map ctf2"
add_vote "Change Map to ctf3" "change_map ctf3"
add_vote "Change Map to ctf4" "change_map ctf4"
add_vote "Change Map to ctf5" "change_map ctf5"
add_vote "Change Map to dm1" "change_map dm1"
add_vote "Change Map to dm2" "change_map dm2"
add_vote "Change Map to dm6" "change_map dm6"
add_vote "Change Map to dm7" "change_map dm7"
add_vote "Change Map to dm8" "change_map dm8"
add_vote "Change Map to dm9" "change_map dm9"
EOF
cat > /etc/systemd/system/teeworlds.service <<EOF
[Unit]
Description=Teeworlds server
After=network.target
[Service]
ExecStart=${teeworld_directory}/teeworlds_srv -f /etc/teeworlds.cfg
Restart=on-failure
User=${systemuser}
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable --now teeworlds.service
firewall-cmd --zone=public --add-port=8303/udp --permanent

51
scripts/deploy_unvanguished.sh Executable file
View File

@ -0,0 +1,51 @@
#!/bin/bash
set -e
# Unvanguished
unvanquished_directory="/opt/unvanquished-${unvanquished_version}"
curl --location "https://github.com/Unvanquished/Unvanquished/releases/download/v${unvanquished_version}/unvanquished_${unvanquished_version}.zip" > ${TMPDIR:-/tmp}/unvanquished.zip
unzip -o -f -d ${TMPDIR:-/tmp} ${TMPDIR:-/tmp}/unvanquished.zip
mkdir -p ${unvanquished_directory}/bin ${unvanquished_directory}/share
unzip -o -f -d ${unvanquished_directory}/bin ${TMPDIR:-/tmp}/unvanquished*/linux-amd64.zip
if [ -d ${unvanquished_directory}/share/pkg ]; then
rm -rf ${unvanquished_directory}/share/pkg
fi
mv ${TMPDIR:-/tmp}/unvanquished*/pkg ${unvanquished_directory}/share
rm -rf ${TMPDIR:-/tmp}/unvanquished*
mkdir -p ${systemuserhome}/unvanguished_home/config
cat > ${systemuserhome}/unvanguished_home/config/unvanguished.cfg <<EOF
set server.private 1
set g_needpass 0
set sv_hostname "^NUnvanquished ^3onFOSS-LAN"
set g_motd "^2get news on ^5${LINODE_ID}"
set sv_allowdownload 0
set sv_maxclients 24
set timelimit 0
set g_emptyTeamsSkipMapTime 15
set g_teamForceBalance 1
set g_mapConfigs "map"
set g_initialMapRotation rotation1
map yocto
EOF
chown -R ${systemuser}: ${systemuserhome}/unvanguished_home
cat > /etc/systemd/system/unvanguished.service <<EOF
[Unit]
Description=Unvanguished server
After=network.target
[Service]
ExecStart=${unvanquished_directory}/bin/daemonded -pakpath ${unvanquished_directory}/share/pkg/ -libpath ${unvanquished_directory}/bin/ -homepath \${HOME}/unvanguished_home/ +exec unvanguished.cfg
Restart=on-failure
User=${systemuser}
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable --now unvanguished.service
firewall-cmd --zone=public --add-port=27960/udp --permanent

51
scripts/deploy_xonotic.sh Executable file
View File

@ -0,0 +1,51 @@
#!/bin/bash
set -e
# Xonotic
xonotic_directory="/opt/xonotic-${xonotic_version}"
curl --location https://dl.xonotic.org/xonotic-${xonotic_version}.zip > ${TMPDIR:-/tmp}/xonotic.zip
mkdir -p "${xonotic_directory}"
unzip -f -o -d ${xonotic_directory} ${TMPDIR:-/tmp}/xonotic.zip
rm -f ${TMPDIR:-/tmp}/xonotic.zip
cat > /etc/xonotic.cfg <<EOF
sv_public 0
hostname "onFOSS"
maxplayers 64
port 26000
log_file "server.log"
g_start_delay 15
g_maplist ""
g_maplist_shuffle 1
gametype dm
rcon_password "onFOSS"
bot_number 4
skill 8
minplayers 4
bot_prefix [BOT]
g_maplist_votable 6
sv_vote_gametype 1
sv_vote_gametype_options "dm tdm dom ctf ca rc nb as kh inv ka lms ons"
sv_vote_call 1
sv_weaponstats_file http://www.xonotic.org/weaponbalance/
EOF
cat > /etc/systemd/system/xonoto.service <<EOF
[Unit]
Description=Unvanguished server
After=network.target
[Service]
WorkingDirectory=${xonotic_directory}
ExecStart=${xonotic_directory}daemonded -pakpath ${unvanquished_directory}/share/pkg/ -libpath ${unvanquished_directory}/bin/ -homepath \${HOME}/unvanguished_home/ +exec unvanguished.cfg
Restart=on-failure
User=${systemuser}
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable --now xonoto.service
firewall-cmd --zone=public --add-port=26000/udp --permanent