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