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