fix_steamcmd.sh 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/bin/bash
  2. # LinuxGSM fix_steamcmd.sh function
  3. # Author: Daniel Gibbs
  4. # Website: https://linuxgsm.com
  5. # Description: Resolves various issues related to SteamCMD.
  6. local commandname="FIX"
  7. local commandaction="Fix"
  8. local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")
  9. # Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam,or a local steamclient.so.
  10. if [ ! -f "${HOME}/.steam/sdk32/steamclient.so" ]; then
  11. fixname="steamclient.so"
  12. fn_fix_msg_start
  13. mkdir -pv "${HOME}/.steam/sdk32" >> "${lgsmlog}"
  14. cp -v "${steamcmddir}/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so" >> "${lgsmlog}"
  15. fn_fix_msg_end
  16. fi
  17. if [ "${shortname}" == "bt" ]; then
  18. # Fixes: [S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed.
  19. if [ ! -L "${executabledir}/lib64/steamclient.so" ]; then
  20. fixname="steamclient.so x86_64"
  21. fn_fix_msg_start
  22. cp -s -v "${steamcmddir}/linux64/steamclient.so" "${executabledir}/lib64/steamclient.so" >> "${lgsmlog}"
  23. fn_fix_msg_end
  24. fi
  25. elif [ "${shortname}" == "ss3" ]; then
  26. # Fixes: .steam/bin32/libsteam.so: cannot open shared object file: No such file or directory
  27. if [ ! -f "${HOME}/.steam/bin32/libsteam.so" ]; then
  28. fixname="libsteam.so"
  29. fn_fix_msg_start
  30. mkdir -pv "${HOME}/.steam/bin32" >> "${lgsmlog}"
  31. cp "${serverfiles}/Bin/libsteam.so" "${HOME}/.steam/bin32/libsteam.so" >> "${lgsmlog}"
  32. fn_fix_msg_end
  33. fi
  34. elif [ "${shortname}" == "hw" ]; then
  35. # Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so.
  36. if [ ! -f "${serverfiles}/Hurtworld_Data/Plugins/x86/steamclient.so" ]; then
  37. fixname="steamclient.so x86"
  38. fn_fix_msg_start
  39. cp "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86/steamclient.so" >> "${lgsmlog}"
  40. fn_fix_msg_end
  41. fi
  42. if [ ! -f "${serverfiles}/Hurtworld_Data/Plugins/x86_64/steamclient.so" ]; then
  43. fixname="steamclient.so x86_64"
  44. fn_fix_msg_start
  45. cp "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86_64/steamclient.so" >> "${lgsmlog}"
  46. fn_fix_msg_end
  47. fi
  48. elif [ "${shortname}" == "tu" ]; then
  49. # Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so.
  50. if [ ! -f "${executabledir}/steamclient.so" ]; then
  51. fixname="steamclient.so"
  52. fn_fix_msg_start
  53. cp -v "${serverfiles}/linux64/steamclient.so" "${executabledir}/steamclient.so" >> "${lgsmlog}"
  54. fn_fix_msg_end
  55. fi
  56. fi