fix_glibc.sh 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/bin/bash
  2. # LGSM fix_glibc.sh function
  3. # Author: Daniel Gibbs
  4. # Website: https://gameservermanagers.com
  5. # Description: Downloads required Glibc files and applies the Glibc fix if required.
  6. local commandname="FIX"
  7. local commandaction="Fix"
  8. local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
  9. local libstdc_servers_array=( "ARMA 3" "Blade Symphony" "Garry's Mod" "GoldenEye: Source" "Just Cause 2" )
  10. for libstdc_server in "${libstdc_servers_array[@]}"
  11. do
  12. if [ "${gamename}" == "${libstdc_server}" ]; then
  13. fn_fetch_file_github "lgsm/lib/ubuntu12.04/i386" "libstdc++.so.6" "${lgsmdir}/lib" "noexecutecmd" "norun" "noforce" "nomd5"
  14. fi
  15. done
  16. local libm_servers_array=( "Black Mesa: Deathmatch" "Codename CURE" "Day of Infamy" "Double Action: Boogaloo" "Empires Mod" "Fistful of Frags" "Garry's Mod" "GoldenEye: Source" "Insurgency" "Natural Selection 2" "NS2: Combat" "No More Room in Hell" )
  17. for libm_server in "${libm_servers_array[@]}"
  18. do
  19. if [ "${gamename}" == "${libm_server}" ]; then
  20. fn_fetch_file_github "lgsm/lib/ubuntu12.04/i386" "libm.so.6" "${lgsmdir}/lib" "noexecutecmd" "norun" "noforce" "nomd5"
  21. fi
  22. done
  23. local libc_servers_array=( "Black Mesa: Deathmatch" "Blade Symphony" "Garry's Mod" "GoldenEye: Source" )
  24. for libc_server in "${libc_servers_array[@]}"
  25. do
  26. if [ "${gamename}" == "${libc_server}" ]; then
  27. fn_fetch_file_github "lgsm/lib/ubuntu12.04/i386" "libc.so.6" "${lgsmdir}/lib" "noexecutecmd" "norun" "noforce" "nomd5"
  28. fi
  29. done
  30. local libpthread_servers_array=( "Black Mesa: Deathmatch" "Blade Symphony" "Garry's Mod" )
  31. for libpthread_server in "${libpthread_servers_array[@]}"
  32. do
  33. if [ "${gamename}" == "${libpthread_server}" ]; then
  34. fn_fetch_file_github "lgsm/lib/ubuntu12.04/i386" "libpthread.so.0" "${lgsmdir}/lib" "noexecutecmd" "norun" "noforce" "nomd5"
  35. fi
  36. done
  37. if [ "${gamename}" == "Call of Duty: United Offensive" ]; then
  38. fn_fetch_file_github "lgsm/lib/gcc3" "libgcc_s.so.1" "${lgsmdir}/lib" "noexecutecmd" "norun" "noforce" "nomd5"
  39. fn_fetch_file_github "lgsm/lib/gcc3" "libstdc++.so.5.0.3" "${lgsmdir}/lib" "noexecutecmd" "norun" "noforce" "nomd5"
  40. if [ ! -f "${lgsmdir}/lib/libstdc++.so.5" ]; then
  41. ln -s "${lgsmdir}/lib/libstdc++.so.5.0.3" "${lgsmdir}/lib/libstdc++.so.5"
  42. fi
  43. fi
  44. export LD_LIBRARY_PATH=:"${libdir}"