diff --git a/functions/fn_updateserver b/functions/fn_updateserver new file mode 100644 index 000000000..537f970ff --- /dev/null +++ b/functions/fn_updateserver @@ -0,0 +1,16 @@ +#!/bin/bash +# LGSM fn_updateserver function +# Author: Daniel Gibbs +# Website: http://danielgibbs.co.uk +# Version: 011214 + +fn_rootcheck +fn_syscheck +fn_printdots "Updating ${servicename}: ${servername}" +sleep 1 +fn_printok "Updating ${servicename}: ${servername}" +sleep 1 +fn_scriptlog "Updating ${servername}" +cd "${rootdir}" +cd "steamcmd" +./steamcmd.sh +login ${steamuser} "${steampass}" +force_install_dir "${filesdir}" +app_update ${appid} +quit|tee -a "${scriptlog}" diff --git a/functions/fn_ut2k4compressmaps b/functions/fn_ut2k4compressmaps new file mode 100644 index 000000000..b39f8b6ff --- /dev/null +++ b/functions/fn_ut2k4compressmaps @@ -0,0 +1,33 @@ +#!/bin/bash +# LGSM fn_ut2k4compressmaps function +# Author: Daniel Gibbs +# Website: http://danielgibbs.co.uk +# Version: 011214 + +fn_rootcheck +clear +echo "${gamename} Map Compressor" +echo "============================" +echo "Will compress all maps in:" +echo "" +pwd +echo "" +echo "Compressed maps saved to:" +echo "" +echo "${compressedmapsdir}" +echo "" +while true; do + read -p "Start compression [y/N]" yn + case $yn in + [Yy]* ) break;; + [Nn]* ) echo Exiting; return 1;; + * ) echo "Please answer yes or no.";; + esac +done +mkdir -pv "${compressedmapsdir}" > /dev/null 2>&1 +rm -rfv "${filesdir}/Maps/*.uz2" +cd "${systemdir}" +for map in `ls "${filesdir}/Maps"`; do + ./ucc-bin compress ../Maps/${map} --nohomedir +done +mv -fv "${filesdir}/Maps/*.uz2" "${compressedmapsdir}" \ No newline at end of file diff --git a/functions/fn_ut2k4filesdl b/functions/fn_ut2k4filesdl new file mode 100644 index 000000000..cdfdbdeb5 --- /dev/null +++ b/functions/fn_ut2k4filesdl @@ -0,0 +1,54 @@ +#!/bin/bash +# LGSM fn_ut2k4filesdl function +# Author: Daniel Gibbs +# Website: http://danielgibbs.co.uk +# Version: 011214 + +echo "Downloading Server Files" +echo "=================================" +cd "${rootdir}" +mkdir -pv "${filesdir}" +cd "${filesdir}" +if [ ! -f dedicatedserver3339-bonuspack.zip ]; then + wget -nv -N http://danielgibbs.co.uk/wp-content/uploads/ut2004/dedicatedserver3339-bonuspack.zip +else + echo "dedicatedserver3339-bonuspack.zip already downloaded!" +fi +echo "Running MD5 checksum to verify the file" +sleep 1 +echo "MD5 checksum: d3f28c5245c4c02802d48e4f0ffd3e34" +md5check=$(md5sum dedicatedserver3339-bonuspack.zip|awk '{print $1;}') +echo "File returned: ${md5check}" +if [ "${md5check}" != "d3f28c5245c4c02802d48e4f0ffd3e34" ]; then + echo "MD5 checksum: FAILED!" + read -p "Retry download? [y/N]" yn + case $yn in + [Yy]* ) rm -fv dedicatedserver3339-bonuspack.zip; fn_ut2k4filesdl;; + [Nn]* ) echo Exiting; exit;; + * ) echo "Please answer yes or no.";; + esac +else + echo "MD5 checksum: PASSED" +fi +if [ ! -f ut2004-lnxpatch3369-2.tar.bz2 ]; then + wget -nv -N http://danielgibbs.co.uk/wp-content/uploads/ut2004/ut2004-lnxpatch3369-2.tar.bz2 +else + echo "ut2004-lnxpatch3369-2.tar.bz2 already downloaded!" +fi +echo "Running MD5 checksum to verify the file" +sleep 1 +echo "MD5 checksum: 0fa447e05fe5a38e0e32adf171be405e" +md5check=$(md5sum ut2004-lnxpatch3369-2.tar.bz2|awk '{print $1;}') +echo "File returned: ${md5check}" +if [ "${md5check}" != "0fa447e05fe5a38e0e32adf171be405e" ]; then + echo "MD5 checksum: FAILED!" + read -p "Retry download? [y/N]" yn + case $yn in + [Yy]* ) rm -fv ut2004-lnxpatch3369-2.tar.bz2; fn_ut2k4filesdl;; + [Nn]* ) echo Exiting; exit;; + * ) echo "Please answer yes or no.";; + esac +else + echo "MD5 checksum: PASSED" +fi +echo "" \ No newline at end of file diff --git a/functions/fn_ut2k4key b/functions/fn_ut2k4key new file mode 100644 index 000000000..f3bb9c9a5 --- /dev/null +++ b/functions/fn_ut2k4key @@ -0,0 +1,18 @@ +#!/bin/bash +# LGSM fn_ut2k4key function +# Author: Daniel Gibbs +# Website: http://danielgibbs.co.uk +# Version: 011214 + +echo "Enter ${gamename} CD Key" +echo "=================================" +sleep 1 +echo "To get your server listed on the Master Server list" +echo "you must get a free CD key. Get a key here:" +echo "http://www.unrealtournament.com/ut2004server/cdkey.php" +echo "" +echo "Once you have the key enter it below" +echo -n "KEY: " +read CODE +echo ""\""CDKey"\""="\""${CODE}"\""" > "${systemdir}/cdkey" +echo "" \ No newline at end of file diff --git a/functions/fn_validateserver b/functions/fn_validateserver new file mode 100644 index 000000000..aa3370a0a --- /dev/null +++ b/functions/fn_validateserver @@ -0,0 +1,22 @@ +#!/bin/bash +# LGSM fn_validateserver function +# Author: Daniel Gibbs +# Website: http://danielgibbs.co.uk +# Version: 011214 + +fn_rootcheck +fn_syscheck +fn_printwarn "Validating may overwrite some customised files." +sleep 1 +echo -en "\n" +echo -en "https://developer.valvesoftware.com/wiki/SteamCMD#Validate" +sleep 5 +echo -en "\n" +fn_printdots "Validating ${servicename}: ${servername}" +sleep 1 +fn_printok "Validating ${servicename}: ${servername}" +sleep 1 +fn_scriptlog "Validating ${servername}" +cd "${rootdir}" +cd "steamcmd" +./steamcmd.sh +login ${steamuser} "${steampass}" +force_install_dir "${filesdir}" +app_update ${appid} validate +quit|tee -a "${scriptlog}"