Skip to content

Commit

Permalink
feat: steamclient.so is now checked to ensure lastest version
Browse files Browse the repository at this point in the history
  • Loading branch information
dgibbs64 committed Nov 24, 2023
1 parent e78a9df commit 7af165e
Showing 1 changed file with 50 additions and 4 deletions.
54 changes: 50 additions & 4 deletions lgsm/modules/fix_steamcmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -114,17 +142,35 @@ 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
fn_fix_steamclient_so "32" "${executabledir}/lib"
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"
Expand Down

0 comments on commit 7af165e

Please sign in to comment.