#!/bin/sh REPO="https://github.com/packetflinger/q2admin.git" PWD="/home/quake/q2/build" TARGET=$1 if [ -z "$1" ]; then echo -e "specify a target game folder...\n" exit 1 fi #test ! -f `which distro` && echo "distro script missing" && exit #if [ -n '`distro | grep "CentOS 6"`' ]; then # yum -y install curl-devel glib2-devel #elif [ -n '`distro | grep "Debian 8"`' ]; then # apt-get -y install libcurl4-openssl-dev glib-2.0-dev #elif [ -n '`distro | grep "Debian 9"`' ]; then # apt -y install libcurl4-openssl-dev glib-2.0-dev #fi cd $PWD if [ ! -d "q2admin" ]; then git clone $REPO cd q2admin else cd q2admin make clean git pull origin master fi make LIB=`ls -1 game*.so` yes | cp -f $LIB ../../$TARGET/ # copy default runtime config if not there already if [ ! -f "../../$TARGET/q2admin.cfg" ]; then yes | cp -R runtime-config/* ../../$TARGET/ fi make clean cd ../../$TARGET TDMLIB=`ls -1 game*opentdm*.so |tail -1` if [ -f "q2admin.cfg" ] && [ -n "$TDMLIB" ]; then # change the gamelibrary config option for the new opentdm so sed -i -re "s/^gamelibrary.+\$/gamelibrary \"$TDMLIB\"/" q2admin.cfg # get rid of any ^M chars at the end of the lines sed -i -e "s/\r//" q2admin.cfg fi if [ -f game`uname -m`.so ]; then yes | rm -f game`uname -m`.so fi ln -s $LIB game`uname -m`.so