Browse Source

added ut2k4server functions

pull/254/merge
Daniel Gibbs 10 years ago
parent
commit
6ff94ba075
  1. 26
      functions/fn_serverconfig
  2. 27
      functions/fn_ut2k4fix
  3. 42
      functions/fn_ut2k4install

26
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

27
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

42
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 ""
Loading…
Cancel
Save