From 6ff94ba07594d8d967dc097a0ee21a1ab40ce5a0 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 2 Dec 2014 13:56:11 +0000 Subject: [PATCH] added ut2k4server functions --- functions/fn_serverconfig | 26 ++++++++++++++++++++++++ functions/fn_ut2k4fix | 27 +++++++++++++++++++++++++ functions/fn_ut2k4install | 42 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 95 insertions(+) create mode 100644 functions/fn_ut2k4fix create mode 100644 functions/fn_ut2k4install diff --git a/functions/fn_serverconfig b/functions/fn_serverconfig index 7cdf01521..1ac42cc91 100644 --- a/functions/fn_serverconfig +++ b/functions/fn_serverconfig @@ -56,6 +56,29 @@ sed -i "s/\"rconpassword\"/\"${rconpass}\"/g" "${servercfgfullpath}" echo "" } +fn_ut2k4config(){ +echo "" +echo "Loading Configs" +echo "=================================" +sleep 1 +cp -v "${defaultcfg}" "${systemdir}/${ini}" +sleep 1 +echo "" +echo "Configuring ${gamename} Server" +echo "=================================" +sleep 1 +echo "Setting WebAdmin username and password" +sed -i 's/AdminName=/AdminName=admin/g' "${systemdir}/${ini}" +sed -i 's/AdminPassword=/AdminPassword=admin/g' "${systemdir}/${ini}" +sleep 1 +echo "Enabling WebAdmin" +sed -i 's/bEnabled=False/bEnabled=True/g' "${systemdir}/${ini}" +sleep 1 +echo "Setting WebAdmin port to 8077" +sed -i 's/ListenPort=80/ListenPort=8077/g' "${systemdir}/${ini}" +echo "" +} + echo "Downloading lgsm-default.cfg" echo "=================================" @@ -70,4 +93,7 @@ elif [ "${gamename}" == "Just Cause 2" ]; then elif [ "${gamename}" == "Counter Strike: Source" ]; then wget --no-check-certificate -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/CounterStrikeSource/cfg/lgsm-default.cfg fn_sourceconfig +elif [ "${gamename}" == "Unreal Tournament 2004" ]; then + echo "lgsm-default.cfg not required" + fn_ut2k4config fi \ No newline at end of file diff --git a/functions/fn_ut2k4fix b/functions/fn_ut2k4fix new file mode 100644 index 000000000..3da28026e --- /dev/null +++ b/functions/fn_ut2k4fix @@ -0,0 +1,27 @@ +#!/bin/bash +# LGSM fn_ut2k4fix function +# Author: Daniel Gibbs +# Website: http://danielgibbs.co.uk +# Version: 011214 + +echo "Applying UT2K4 Server Fixes" +echo "=================================" +echo "Applying WebAdmin ut2003.css fix!" +echo "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" +sed -i 's/none}/none;/g' "${filesdir}/Web/ServerAdmin/ut2003.css" +sed -i 's/underline}/underline;/g' "${filesdir}/Web/ServerAdmin/ut2003.css" +sleep 1 +echo "Applying WebAdmin CharSet fix!" +echo "http://forums.tripwireinteractive.com/showpost.php?p=442340&postcount=1" +sed -i 's/CharSet="iso-8859-1"/CharSet="utf-8"/g' "${systemdir}/UWeb.int" +sleep 1 + +sleep 1 +echo "Forcing server to start to get ports/server name to display correctly" +sleep 1 +cd "${rootdir}" +${selfname} start +sleep 5 +${selfname} restart +sleep 5 +${selfname} stop \ No newline at end of file diff --git a/functions/fn_ut2k4install b/functions/fn_ut2k4install new file mode 100644 index 000000000..7e5f00cc5 --- /dev/null +++ b/functions/fn_ut2k4install @@ -0,0 +1,42 @@ +#!/bin/bash +# LGSM fn_ut2k4install function +# Author: Daniel Gibbs +# Website: http://danielgibbs.co.uk +# Version: 011214 + +echo "Installing ${gamename} Server" +echo "=================================" +sleep 1 +mkdir -pv "${filesdir}" +cd "${filesdir}" +echo "Extracting dedicatedserver3339-bonuspack.zip" +sleep 1 +unzip dedicatedserver3339-bonuspack.zip +echo "Extracting ut2004-lnxpatch3369-2.tar.bz2" +sleep 1 +tar -xvjf ut2004-lnxpatch3369-2.tar.bz2 UT2004-Patch/ --strip-components=1 +while true; do + read -p "Was the install successful? [y/N]" yn + case $yn in + [Yy]* ) break;; + [Nn]* ) fn_retryinstall;; + * ) echo "Please answer yes or no.";; +esac +done +while true; do + read -p "Remove ut2004-lnxpatch3369-2.tar.bz2? [y/N]" yn + case $yn in + [Yy]* ) rm -fv ut2004-lnxpatch3369-2.tar.bz2; break;; + [Nn]* ) break;; + * ) echo "Please answer yes or no.";; + esac +done +while true; do + read -p "Remove dedicatedserver3339-bonuspack.zip? [y/N]" yn + case $yn in + [Yy]* ) rm -fv dedicatedserver3339-bonuspack.zip; break;; + [Nn]* ) break;; + * ) echo "Please answer yes or no.";; + esac +done +echo "" \ No newline at end of file