#!/bin/bash # make a quake user if not present if [ -z `cat /etc/passwd | grep quake` ]; then adduser --disabled-password --gecos "" quake fi cd /home/quake # remove existing if [ -f ./q2-tdm.zip.aes ]; then unlink ./q2-tdm.zip.aes fi # remove again if [ -f ./q2-tdm.zip ]; then unlink ./q2-tdm.zip fi # grab the encrypted archive sudo -u quake wget q2.pfl.gr/dl/deploy/q2-tdm.zip.aes # decrypt it (it'll prompt for the key) sudo -u quake openssl aes-256-cbc -d -in ./q2-tdm.zip.aes -out ./q2-tdm.zip # expand it if [ ! -d ./q2 ]; then sudo -u quake mkdir q2 fi cd q2 sudo -u quake unzip -qq ../q2-tdm.zip # setup systemd service sudo cp maint/q2\@.service /etc/systemd/system sudo systemctl daemon-reload sudo systemctl enable q2@tdm sudo -u quake unlink q2-tdm.zip.aes sudo -u quake unlink q2-tdm.zip echo -e "\n\n\nEdit \"q2/opentdm/server.cfg\" and then run \"systemctl start q2@tdm\" to start server \n"