Soldat is opensoldat now

This commit is contained in:
DeathByDenim 2022-07-10 13:01:03 -04:00
parent 5a6c5817dc
commit fcf1508e22
1 changed files with 22 additions and 22 deletions

View File

@ -1,37 +1,37 @@
#!/bin/bash
set -e
if [ -e /etc/systemd/system/soldat.service ]; then
systemctl stop soldat
if [ -e /etc/systemd/system/opensoldat.service ]; then
systemctl stop opensoldat
fi
# Install dependencies
sudo apt-get -y install build-essential g++ cmake git fpc libprotobuf-dev protobuf-compiler libssl-dev libsdl2-dev libopenal-dev libphysfs-dev libfreetype6
# Install BZFlag
builddir=${TMPDIR:-/tmp}/soldat-build
builddir=${TMPDIR:-/tmp}/opensoldat-build
mkdir -p ${builddir}
cd ${builddir}
if [ -d soldat ]; then
rm -rf soldat
if [ -d opensoldat ]; then
rm -rf opensoldat
fi
git clone https://github.com/opensoldat/opensoldat.git
git clone https://github.com/opensoldat/base.git
cd opensoldat
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/soldat ..
cmake -DCMAKE_INSTALL_PREFIX=/opt/opensoldat ..
make
make install
mkdir -p /opt/soldat/bin/configs
cp -r ${builddir}/base/server/configs/bots /opt/soldat/bin/configs/bots
mkdir -p /opt/opensoldat/bin/configs
cp -r ${builddir}/base/server/configs/bots /opt/opensoldat/bin/configs/bots
if ! [ -L /usr/games/soldatserver ]; then
ln -s /opt/soldat/bin/soldatserver /usr/games/
if ! [ -L /usr/games/opensoldatserver ]; then
ln -s /opt/opensoldat/bin/opensoldatserver /usr/games/
fi
rm -rf ${builddir}
cat > /opt/soldat/bin/configs/server_dm.cfg <<EOF
cat > /opt/opensoldat/bin/configs/server_dm.cfg <<EOF
sv_hostname "onFOSS LAN"
bots_random_alpha 0
sv_gamemode 0
@ -40,7 +40,7 @@ sv_website ${DOMAINNAME}
bots_chat false
EOF
cat > /opt/soldat/bin/configs/server_ctf.cfg <<EOF
cat > /opt/opensoldat/bin/configs/server_ctf.cfg <<EOF
sv_hostname "onFOSS LAN"
bots_random_alpha 0
sv_gamemode 3
@ -50,11 +50,11 @@ bots_chat false
sv_maplist "mapslist_ctf.txt"
EOF
if ! [ -L /opt/soldat/bin/configs/server.cfg ]; then
ln -s ./server_dm.cfg /opt/soldat/bin/configs/server.cfg
if ! [ -L /opt/opensoldat/bin/configs/server.cfg ]; then
ln -s ./server_dm.cfg /opt/opensoldat/bin/configs/server.cfg
fi
cat > /opt/soldat/bin/configs/mapslist.txt <<EOF
cat > /opt/opensoldat/bin/configs/mapslist.txt <<EOF
Aero
Airpirates
Arena2
@ -86,7 +86,7 @@ Unlim
Veoto
EOF
cat > /opt/soldat/bin/configs/mapslist_ctf.txt <<EOF
cat > /opt/opensoldat/bin/configs/mapslist_ctf.txt <<EOF
ctf_Aftermath
ctf_Amnesia
ctf_Ash
@ -123,7 +123,7 @@ ctf_Wretch
ctf_X
EOF
cat > /opt/soldat/bin/configs/mapslist_htf.txt <<EOF
cat > /opt/opensoldat/bin/configs/mapslist_htf.txt <<EOF
htf_Arch
htf_Baire
htf_Boxed
@ -145,7 +145,7 @@ htf_Vortex
htf_Zajacz
EOF
cat > /opt/soldat/bin/configs/mapslist_inf.txt <<EOF
cat > /opt/opensoldat/bin/configs/mapslist_inf.txt <<EOF
inf_Abel
inf_April
inf_Argy
@ -165,16 +165,16 @@ inf_Warehouse
inf_Warlock
EOF
chown -R ${systemuser}: /opt/soldat/bin/configs
chown -R ${systemuser}: /opt/opensoldat/bin/configs
# Create SystemD unit
cat > /etc/systemd/system/soldat.service <<EOF
cat > /etc/systemd/system/opensoldat.service <<EOF
[Unit]
Description=Soldat server
After=network.target
[Service]
ExecStart=/usr/games/soldatserver -sv_adminpassword "${systempassword}"
ExecStart=/usr/games/opensoldatserver -sv_adminpassword "${systempassword}"
Restart=on-failure
User=${systemuser}
@ -183,7 +183,7 @@ WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable --now soldat.service
systemctl enable --now opensoldat.service
# Add firewall rules
firewall-cmd --zone=public --add-port=23073/udp --permanent