#!/bin/bash set -e 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}/opensoldat-build mkdir -p ${builddir} cd ${builddir} 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/opensoldat -DBUILD_CLIENT=False .. make make install mkdir -p /opt/opensoldat/bin/configs cp -r ${builddir}/base/server/configs/bots /opt/opensoldat/bin/configs/bots if ! [ -L /usr/games/opensoldatserver ]; then ln -s /opt/opensoldat/bin/opensoldatserver /usr/games/ fi rm -rf ${builddir} cat > /opt/opensoldat/bin/configs/server_dm.cfg < /opt/opensoldat/bin/configs/server_ctf.cfg < /opt/opensoldat/bin/configs/mapslist.txt < /opt/opensoldat/bin/configs/mapslist_ctf.txt < /opt/opensoldat/bin/configs/mapslist_htf.txt < /opt/opensoldat/bin/configs/mapslist_inf.txt < /etc/systemd/system/opensoldat.service < /etc/systemd/system/opensoldat-monitor.service < /etc/nginx/gameserver.d/opensoldat.conf <