From 995a4c584d738a414c5ef5f2bec870084fd72126 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 1 Mar 2016 19:23:58 +0000 Subject: [PATCH] Optimised fixes removed un-needed code --- functions/fix.sh | 23 ++++++++++++++++++-- functions/fix_arma3.sh | 26 +++------------------- functions/fix_csgo.sh | 44 +++++++++++--------------------------- functions/fix_dst.sh | 28 ++++-------------------- functions/fix_ro.sh | 4 ++-- functions/fix_steamcmd.sh | 45 +++++++++++---------------------------- functions/fix_ut2k4.sh | 15 +++++-------- 7 files changed, 61 insertions(+), 124 deletions(-) diff --git a/functions/fix.sh b/functions/fix.sh index 931f4acbe..86e397ee6 100644 --- a/functions/fix.sh +++ b/functions/fix.sh @@ -2,11 +2,31 @@ # LGSM fix.sh function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -lgsm_version="020116" +lgsm_version="010316" # Description: Overall function for managing fixes. # Runs functions that will fix an issue. +# Messages that are displayed for some fixes +fn_fix_msg_start(){ + fn_print_dots "Applying ${fixname} fix: ${gamename}" + sleep 1 + fn_print_info "Applying ${fixname} fix: ${gamename}" + fn_scriptlog "Applying ${fixname} fix: ${gamename}" + sleep 1 +} + +fn_fix_msg_end(){ + if [ $? -ne 0 ]; then + fn_print_fail_nl "Applying ${fixname} fix: ${gamename}" + fn_scriptlog "Failure! Applying ${fixname} fix: ${gamename}" + else + fn_print_ok_nl "Applying ${fixname} fix: ${gamename}" + fn_scriptlog "Complete! Applying ${fixname} fix: ${gamename}" + fi +} + + # Fixes that are run on start if [ "${function_selfname}" != "command_install.sh" ]; then if [ ! -z "${appid}" ]; then @@ -14,7 +34,6 @@ if [ "${function_selfname}" != "command_install.sh" ]; then fi if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then - startfix=1 fix_csgo.sh elif [ "${gamename}" == "Don't Starve Together" ]; then fix_dst.sh diff --git a/functions/fix_arma3.sh b/functions/fix_arma3.sh index b076fe065..ffc607ed6 100644 --- a/functions/fix_arma3.sh +++ b/functions/fix_arma3.sh @@ -4,30 +4,10 @@ # Website: http://gameservermanagers.com lgsm_version="301215" -# Fixes line 63: 20150 Segmentation fault (core dumped) #488 - -fn_msg_start(){ - fn_print_dots "Applying ${fixname} fix: ${gamename}" - sleep 1 - fn_print_info "Applying ${fixname} fix: ${gamename}" - fn_scriptlog "Applying ${fixname} fix: ${gamename}" - sleep 1 -} - -fn_msg_end(){ - if [ $? -ne 0 ]; then - fn_print_fail_nl "Applying ${fixname} fix: ${gamename}" - fn_scriptlog "Failure! Applying ${fixname} fix: ${gamename}" - else - fn_print_ok_nl "Applying ${fixname} fix: ${gamename}" - fn_scriptlog "Complete! Applying ${fixname} fix: ${gamename}" - fi -} - # Fixes: server not always creating steam_appid.txt file. if [ ! -d "${rootdir}/.local/share/Arma\ 3" ]; then - local fixname="20150 Segmentation fault (core dumped)" - fn_msg_start + fixname="20150 Segmentation fault (core dumped)" + fn_fix_msg_start mkdir -p "${rootdir}/.local/share/Arma\ 3" - fn_msg_end + fn_fix_msg_end fi \ No newline at end of file diff --git a/functions/fix_csgo.sh b/functions/fix_csgo.sh index 33fd7c169..f968640ce 100644 --- a/functions/fix_csgo.sh +++ b/functions/fix_csgo.sh @@ -2,60 +2,42 @@ # LGSM fix_csgo.sh function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -lgsm_version="301215" +lgsm_version="010316" # Description: Resolves various issues with csgo. -fn_msg_start(){ - fn_print_dots "Applying ${fixname} fix: ${gamename}" - sleep 1 - fn_print_info "Applying ${fixname} fix: ${gamename}" - fn_scriptlog "Applying ${fixname} fix: ${gamename}" - sleep 1 -} - -fn_msg_end(){ - if [ $? -ne 0 ]; then - fn_print_fail_nl "Applying ${fixname} fix: ${gamename}" - fn_scriptlog "Failure! Applying ${fixname} fix: ${gamename}" - else - fn_print_ok_nl "Applying ${fixname} fix: ${gamename}" - fn_scriptlog "Complete! Applying ${fixname} fix: ${gamename}" - fi -} - # Fixes: server not always creating steam_appid.txt file. if [ ! -f "${filesdir}/steam_appid.txt" ]; then - local fixname="730 steam_appid.txt" - fn_msg_start + fixname="730 steam_appid.txt" + fn_fix_msg_start echo -n "730" >> "${filesdir}/steam_appid.txt" - fn_msg_end + fn_fix_msg_end fi # Fixes: Error parsing BotProfile.db - unknown attribute 'Rank'". if ! grep -q "//Rank" "${systemdir}/botprofile.db" > /dev/null 2>&1; then - local fixname="botprofile.db" - fn_msg_start + fixname="botprofile.db" + fn_fix_msg_start sed -i 's/\tRank/\t\/\/Rank/g' "${systemdir}/botprofile.db" > /dev/null 2>&1 - fn_msg_end + fn_fix_msg_end fi # Fixes: Unknown command "cl_bobamt_vert". if ! grep -q "//exec default" "${servercfgdir}/valve.rc" > /dev/null 2>&1 || ! grep -q "//exec joystick" "${servercfgdir}/valve.rc" > /dev/null 2>&1; then - local fixname="valve.rc" - fn_msg_start + fixname="valve.rc" + fn_fix_msg_start sed -i 's/exec default.cfg/\/\/exec default.cfg/g' "${servercfgdir}/valve.rc" > /dev/null 2>&1 sed -i 's/exec joystick.cfg/\/\/exec joystick.cfg/g' "${servercfgdir}/valve.rc" > /dev/null 2>&1 - fn_msg_end + fn_fix_msg_end fi # Fixes: workshop map issue. # http://forums.steampowered.com/forums/showthread.php?t=3170366. if [ -f "${systemdir}/subscribed_collection_ids.txt" ]||[ -f "${systemdir}/subscribed_file_ids.txt" ]||[ -f "${systemdir}/ugc_collection_cache.txt" ]; then - local fixname="workshop map" - fn_msg_start + fixname="workshop map" + fn_fix_msg_start rm -f "${systemdir}/subscribed_collection_ids.txt" rm -f "${systemdir}/subscribed_file_ids.txt" rm -f "${systemdir}/ugc_collection_cache.txt" - fn_msg_end + fn_fix_msg_end fi \ No newline at end of file diff --git a/functions/fix_dst.sh b/functions/fix_dst.sh index b860f6d09..feec27b14 100644 --- a/functions/fix_dst.sh +++ b/functions/fix_dst.sh @@ -2,33 +2,13 @@ # LGSM fix_dst.sh function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -lgsm_version="020116" - -# Fixes line 63: 20150 Segmentation fault (core dumped) #488 - -fn_msg_start(){ - fn_print_dots "Applying ${fixname} fix: ${gamename}" - sleep 1 - fn_print_info "Applying ${fixname} fix: ${gamename}" - fn_scriptlog "Applying ${fixname} fix: ${gamename}" - sleep 1 -} - -fn_msg_end(){ - if [ $? -ne 0 ]; then - fn_print_fail_nl "Applying ${fixname} fix: ${gamename}" - fn_scriptlog "Failure! Applying ${fixname} fix: ${gamename}" - else - fn_print_ok_nl "Applying ${fixname} fix: ${gamename}" - fn_scriptlog "Complete! Applying ${fixname} fix: ${gamename}" - fi -} +lgsm_version="010316" # Fixes: ./dontstarve_dedicated_server_nullrenderer: ./lib32/libcurl-gnutls.so.4: no version information available (required by ./dontstarve_dedicated_server_nullrenderer) # Issue only occures on CentOS as libcurl-gnutls.so.4 is called libcurl.so.4 on CentOS. if [ -f "/etc/redhat-release" ] && [ ! -f "${filesdir}/bin/lib32/libcurl-gnutls.so.4" ]; then - local fixname="libcurl-gnutls.so.4 missing" - fn_msg_start + fixname="libcurl-gnutls.so.4 missing" + fn_fix_msg_start ln -s "/usr/lib/libcurl.so.4" "${filesdir}/bin/lib32/libcurl-gnutls.so.4" - fn_msg_end + fn_fix_msg_end fi \ No newline at end of file diff --git a/functions/fix_ro.sh b/functions/fix_ro.sh index d3d0ac0e2..a7c703e1a 100644 --- a/functions/fix_ro.sh +++ b/functions/fix_ro.sh @@ -2,14 +2,14 @@ # LGSM fix_ro.sh function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -lgsm_version="271215" +lgsm_version="010316" echo "Applying WebAdmin ROOst.css fix." echo "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" sed -i 's/none}/none;/g' "${filesdir}/Web/ServerAdmin/ROOst.css" sed -i 's/underline}/underline;/g' "${filesdir}/Web/ServerAdmin/ROOst.css" sleep 1 -echo "Applying WebAdmin CharSet fix." +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 diff --git a/functions/fix_steamcmd.sh b/functions/fix_steamcmd.sh index a05f783c4..46f52e4c8 100644 --- a/functions/fix_steamcmd.sh +++ b/functions/fix_steamcmd.sh @@ -2,60 +2,41 @@ # LGSM fix_steamcmd.sh function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -lgsm_version="010116" +lgsm_version="010316" # Description: fixes various issues related to steamCMD. -fn_msg_start(){ - fn_print_dots "Applying ${fixname} fix: ${gamename}" - sleep 1 - fn_print_info "Applying ${fixname} fix: ${gamename}" - fn_scriptlog "Applying ${fixname} fix: ${gamename}" - sleep 1 -} - -fn_msg_end(){ - if [ $? -ne 0 ]; then - fn_print_fail_nl "Applying ${fixname} fix: ${gamename}" - fn_scriptlog "Failure! Applying ${fixname} fix: ${gamename}" - else - fn_print_ok_nl "Applying ${fixname} fix: ${gamename}" - fn_scriptlog "Complete! Applying ${fixname} fix: ${gamename}" - fi -} - - # Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam,or a local steamclient.so. if [ ! -f "${HOME}/.steam/sdk32/steamclient.so" ]; then - local fixname="steamclient.so general" - fn_msg_start + fixname="steamclient.so general" + fn_fix_msg_start mkdir -pv "${HOME}/.steam/sdk32" >> "${scriptlog}" cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so" >> "${scriptlog}" - fn_msg_end + fn_fix_msg_end fi if [ "${gamename}" == "Serious Sam 3: BFE" ]; then # Fixes: .steam/bin32/libsteam.so: cannot open shared object file: No such file or directory if [ ! -f "${HOME}/.steam/bin32/libsteam.so" ]; then - local fixname="libsteam.so" - fn_msg_start + fixname="libsteam.so" + fn_fix_msg_start mkdir -pv "${HOME}/.steam/bin32" >> "${scriptlog}" cp -v "${filesdir}/Bin/libsteam.so" "${HOME}/.steam/bin32/libsteam.so" >> "${scriptlog}" - fn_msg_end + fn_fix_msg_end fi elif [ "${gamename}" == "Hurtworld" ]; then # Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so. if [ ! -f "${filesdir}/Hurtworld_Data/Plugins/x86/steamclient.so" ]; then - local fixname="steamclient.so x86" - fn_msg_start + fixname="steamclient.so x86" + fn_fix_msg_start cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${filesdir}/Hurtworld_Data/Plugins/x86/steamclient.so" >> "${scriptlog}" - fn_msg_end + fn_fix_msg_end fi if [ ! -f "${filesdir}/Hurtworld_Data/Plugins/x86_64/steamclient.so" ]; then - local fixname="steamclient.so x86_64" - fn_msg_start + fixname="steamclient.so x86_64" + fn_fix_msg_start cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${filesdir}/Hurtworld_Data/Plugins/x86_64/steamclient.so" >> "${scriptlog}" - fn_msg_end + fn_fix_msg_end fi fi diff --git a/functions/fix_ut2k4.sh b/functions/fix_ut2k4.sh index b9ec4ad8a..eff67a12c 100644 --- a/functions/fix_ut2k4.sh +++ b/functions/fix_ut2k4.sh @@ -2,7 +2,7 @@ # LGSM fix_ut2k4.sh function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -lgsm_version="271215" +lgsm_version="010316" echo "applying WebAdmin ut2003.css fix." echo "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" @@ -13,15 +13,10 @@ 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 -echo "" -echo -en "forcing server restart.\r" -sleep 0.5 -echo -en "forcing server restart..\r" -sleep 0.5 -echo -en "forcing server restart...\r" -sleep 0.5 -echo -en "\n" -sleep 0.5 +echo "applying server name fix." +sleep 1 +echo "forcing server restart..." +sleep 1 command_start.sh sleep 5 command_stop.sh