From 7af165e69b8e17f5c433cc41fc6acf173e87cf45 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 24 Nov 2023 20:37:41 +0000 Subject: [PATCH] feat: steamclient.so is now checked to ensure lastest version --- lgsm/modules/fix_steamcmd.sh | 54 +++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/lgsm/modules/fix_steamcmd.sh b/lgsm/modules/fix_steamcmd.sh index 2a2076072f..01489a1b53 100644 --- a/lgsm/modules/fix_steamcmd.sh +++ b/lgsm/modules/fix_steamcmd.sh @@ -14,8 +14,22 @@ fn_fix_steamclient_so() { # $1 type of fix 32 or 64 as possible values # $2 as destination where the lib will be copied to if [ "$1" == "32" ]; then + # get md5sum of steamclient.so + if [ -f "${2}/steamclient.so" ]; then + steamclientmd5=$(md5sum "${2}/steamclient.so" | awk '{print $1;}') + fi + + # get md5sum of steamclient.so from steamcmd + if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then + steamcmdsteamclientmd5=$(md5sum "${HOME}/.steam/steamcmd/linux32/steamclient.so" | awk '{print $1;}') + elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then + steamcmdsteamclientmd5=$(md5sum "${steamcmddir}/linux32/steamclient.so" | awk '{print $1;}') + elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux32/steamclient.so" ]; then + steamcmdsteamclientmd5=$(md5sum "${HOME}/.local/share/Steam/steamcmd/linux32/steamclient.so" | awk '{print $1;}') + fi + # steamclient.so x86 fix. - if [ ! -f "${2}/steamclient.so" ]; then + if [ ! -f "${2}/steamclient.so" ] || [ "${steamcmdsteamclientmd5}" != "${steamclientmd5}" ]; then fixname="steamclient.so x86" fn_fix_msg_start if [ ! -d "${2}" ]; then @@ -31,8 +45,22 @@ fn_fix_steamclient_so() { fn_fix_msg_end fi elif [ "$1" == "64" ]; then + # get md5sum of steamclient.so + if [ -f "${2}/steamclient.so" ]; then + steamclientmd5=$(md5sum "${2}/steamclient.so" | awk '{print $1;}') + fi + + # get md5sum of steamclient.so from steamcmd + if [ -f "${HOME}/.steam/steamcmd/linux64/steamclient.so" ]; then + steamcmdsteamclientmd5=$(md5sum "${HOME}/.steam/steamcmd/linux64/steamclient.so" | awk '{print $1;}') + elif [ -f "${steamcmddir}/linux64/steamclient.so" ]; then + steamcmdsteamclientmd5=$(md5sum "${steamcmddir}/linux64/steamclient.so" | awk '{print $1;}') + elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux64/steamclient.so" ]; then + steamcmdsteamclientmd5=$(md5sum "${HOME}/.local/share/Steam/steamcmd/linux64/steamclient.so" | awk '{print $1;}') + fi + # steamclient.so x86_64 fix. - if [ ! -f "${2}/steamclient.so" ]; then + if [ ! -f "${2}/steamclient.so" ] || [ "${steamcmdsteamclientmd5}" != "${steamclientmd5}" ]; then fixname="steamclient.so x86_64" fn_fix_msg_start if [ ! -d "${2}" ]; then @@ -114,7 +142,15 @@ if [ ! -f "${steamclientsdk32}" ]; then fi # steamclient.so fixes -if [ "${shortname}" == "bo" ]; then +if [ "${shortname}" == "ahl" ]; then + fn_fix_steamclient_so "32" "${serverfiles}" + fn_fix_steamclient_so "64" "${serverfiles}/linux64" +elif [ "${shortname}" == "ark" ]; then + fn_fix_steamclient_so "32" "${serverfiles}" + fn_fix_steamclient_so "64" "${serverfiles}/linux64" +elif [ "${shortname}" == "bd" ]; then + fn_fix_steamclient_so "32" "${serverfiles}" +elif [ "${shortname}" == "bo" ]; then fn_fix_steamclient_so "32" "${serverfiles}/BODS_Data/Plugins/x86" fn_fix_steamclient_so "64" "${serverfiles}/BODS_Data/Plugins/x86_64" elif [ "${shortname}" == "cmw" ]; then @@ -122,9 +158,19 @@ elif [ "${shortname}" == "cmw" ]; then elif [ "${shortname}" == "cs" ]; then fn_fix_steamclient_so "32" "${serverfiles}" elif [ "${shortname}" == "col" ]; then - fn_fix_steamclient_so "64" "${serverfiles}" + fn_fix_steamclient_so "32" "${serverfiles}" +elif [ "${shortname}" == "hldm" ]; then + fn_fix_steamclient_so "32" "${serverfiles}" + fn_fix_steamclient_so "64" "${serverfiles}/linux64" +elif [ "${shortname}" == "hw" ]; then + fn_fix_steamclient_so "32" "${serverfiles}" + fn_fix_steamclient_so "64" "${serverfiles}/linux64" +elif [ "${shortname}" == "kf" ]; then + fn_fix_steamclient_so "32" "${serverfiles}/System/steamclient.so" elif [ "${shortname}" == "ins" ]; then fn_fix_steamclient_so "32" "${serverfiles}/bin" +elif [ "${shortname}" == "nmrih" ]; then + fn_fix_steamclient_so "32" "${serverfiles}/bin" elif [ "${shortname}" == "pz" ]; then fn_fix_steamclient_so "32" "${serverfiles}/linux32" fn_fix_steamclient_so "64" "${serverfiles}/linux64"