Tweak OpenSpades config and preload small maps.

This commit is contained in:
DeathByDenim 2022-07-03 14:54:43 -04:00
parent 55b58a8e20
commit d78e813814
Signed by: DeathByDenim
GPG Key ID: 4A475283D925365B
1 changed files with 14 additions and 1 deletions

View File

@ -24,7 +24,15 @@ pip install -U piqueserver
pip install "twisted<21.0.0" # Twisted 22 removed getPage that piqueserver 1.0.0 depends on
pip install "MarkupSafe==2.0.1" # MarkupSafe removed soft_unicode that piqueserver 1.0.0 depends on
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"/ -e s/"#admin = \[\"adminpass1\", \"adminpass2\"\]"/"admin = \[\"${systempassword}\"\]"/
sudo -u ${systemuser} sed -i ${systemuserhome}/.config/piqueserver/config.toml \
-e s/"piqueserver instance"/"onFOSS"/ \
-e s/"#admin = \[\"adminpass1\", \"adminpass2\"\]"/"admin = \[\"${systempassword}\"\]"/ \
-e s/"name = \"Blue\""/"name = \"Cyanide\""/ \
-e s/"color = \[ 0, 0, 255\]"/"color = [ 0, 255, 255]"/ \
-e s/"name = \"Green\""/"name = \"Pinkster\""/ \
-e s/"color = \[ 0, 255, 0\]"/"color = [ 255, 0, 255]"/ \
-e s/" \"classicgen\","/" \"island\",\n \"pinpoint\",\n \"realisticbridge\",\n \"rocketisland\",\n \"submarine\","/ \
-e s/"default_time_limit = \"2hours\""/"default_time_limit = \"20minutes\""/
deactivate
cat > /etc/systemd/system/openspades.service <<EOF
@ -41,6 +49,11 @@ User=${systemuser}
WantedBy=multi-user.target
EOF
for map in island pinpoint realisticbridge rocketisland submarine; do
curl "https://raw.githubusercontent.com/kinvaris/openspades-maps/master/${map}.txt" > ${systemuserhome}/.config/piqueserver/maps/${map}.txt
curl "https://raw.githubusercontent.com/kinvaris/openspades-maps/master/${map}.vxl" > ${systemuserhome}/.config/piqueserver/maps/${map}.vxl
done
systemctl daemon-reload
systemctl enable --now openspades.service