fix_steamcmd.sh 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/bin/bash
  2. # LGSM fix_steamcmd.sh function
  3. # Author: Daniel Gibbs
  4. # Website: http://gameservermanagers.com
  5. lgsm_version="301215"
  6. # Description: fixes various issues related to steamCMD
  7. fn_fix_steamcmd_msg_start(){
  8. fn_printdots "Applying steamclient.so fix: ${gamename}"
  9. sleep 2
  10. fn_printinfo "Applying steamclient.so fix: ${gamename}"
  11. }
  12. fn_fix_steamcmd_msg_end(){
  13. if [ $? -ne 0 ]; then
  14. fn_printfail "Applying steamclient.so fix: ${gamename}"
  15. else
  16. fn_printok "Applying steamclient.so fix: ${gamename}"
  17. fi
  18. }
  19. # Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam,or a local steamclient.so.
  20. if [ ! -f "${HOME}/.steam/sdk32/steamclient.so" ]; then
  21. fn_fix_steamcmd_msg_start
  22. mkdir -pv "${HOME}/.steam/sdk32"
  23. cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
  24. fn_fix_steamcmd_msg_end
  25. fi
  26. if [ "${gamename}" == "Garry's Mod" ]; then
  27. # Fixes: .steam/sdk32/libsteam.so: cannot open shared object file: No such file or directory
  28. if [ ! -f "${HOME}/.steam/sdk32/libsteam.so" ]; then
  29. fn_fix_steamcmd_msg_start
  30. mkdir -pv "${HOME}/.steam/sdk32"
  31. cp -v "${filesdir}/bin/libsteam.so" "${HOME}/.steam/sdk32/libsteam.so"
  32. fn_fix_steamcmd_msg_end
  33. fi
  34. elif [ "${gamename}" == "Serious Sam 3: BFE" ]; then
  35. # Fixes: .steam/bin32/libsteam.so: cannot open shared object file: No such file or directory
  36. if [ ! -f "${HOME}/.steam/bin32/libsteam.so" ]; then
  37. fn_fix_steamcmd_msg_start
  38. mkdir -pv "${HOME}/.steam/bin32"
  39. cp -v "${filesdir}/Bin/libsteam.so" "${HOME}/.steam/bin32/libsteam.so"
  40. fn_fix_steamcmd_msg_end
  41. fi
  42. elif [ "${gamename}" == "Hurtworld" ]; then
  43. # Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so.
  44. if [ ! -f "${filesdir}/Hurtworld_Data/Plugins/x86/steamclient.so" ]; then
  45. fn_fix_steamcmd_msg_start
  46. cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${filesdir}/Hurtworld_Data/Plugins/x86/steamclient.so"
  47. fn_fix_steamcmd_msg_end
  48. fi
  49. if [ ! -f "${filesdir}/Hurtworld_Data/Plugins/x86_64/steamclient.so" ]; then
  50. fn_fix_steamcmd_msg_start
  51. cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${filesdir}/Hurtworld_Data/Plugins/x86_64/steamclient.so"
  52. fn_fix_steamcmd_msg_end
  53. fi
  54. fi