diff --git a/setup-mt b/setup-mt index 91a0c29c..c3a871d3 100755 --- a/setup-mt +++ b/setup-mt @@ -1,7 +1,7 @@ #!/bin/bash source config-file - +if [ $first_install = "y" ]; then echo "Create minetest user" useradd minetest mkdir -p /home/minetest/.minetest @@ -11,6 +11,8 @@ perl -pi.orig -0e 's/^(deb .*\n)# (deb-src)/$1$2/mg' /etc/apt/sources.list apt update apt-get build-dep minetest -y +fi + echo "Compile libspatialindex" rm -rf /tmp/spatialindex git clone https://github.com/libspatialindex/libspatialindex /tmp/spatialindex @@ -54,6 +56,9 @@ git clone --depth 1 --branch "$mt_version" https://github.com/minetest/minetest_ echo "Fix privileges on /home/minetest" chown minetest:minetest /home/minetest/ -cR +if [ $first_install = "y" ]; then + +echo "Configuring firstinstall config" echo "Creating minetestsrv systemd service" echo "[Unit]" > /etc/systemd/system/minetestsrv.service echo "Description=MinetestSRV" >> /etc/systemd/system/minetestsrv.service @@ -69,8 +74,6 @@ echo "[Install]" >> /etc/systemd/system/minetestsrv.service echo "WantedBy=multi-user.target" >> /etc/systemd/system/minetestsrv.service systemctl daemon-reload -if [ $first_install = "y" ]; then -echo "Configuring firstinstall config" apt install postgresql postgresql-contrib -y pg_ctlcluster 12 main start