fix_glibc.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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" "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=( "Codename CURE" "Day of Infamy" "Double Action: Boogaloo" "Empires Mod" "Fistful of Frags" "Garry's Mod" "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=( "Garry's Mod" )
  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=( "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. export LD_LIBRARY_PATH=:"${libdir}"