fn_glibcfix 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #!/bin/bash
  2. # LGSM fn_glibcfix function
  3. # Author: Daniel Gibbs
  4. # Website: http://danielgibbs.co.uk
  5. # Version: 231114
  6. fn_glibcfixmsg(){
  7. echo "Detected ${gamename}"
  8. sleep 1
  9. echo ""
  10. echo "GLIBC Fix required"
  11. echo "============================"
  12. sleep 1
  13. echo -e "\e[0;31mWARNING!\e[0;39m ${gamename} requires GLIBC_${glibcversion} or above"
  14. sleep 1
  15. echo ""
  16. echo -e "Currently installed:\e[0;31m GLIBC_$(ldd --version |grep ldd|awk '{print $NF}')\e[0;39m"
  17. echo -e "Required: =>\e[0;32m GLIBC_${glibcversion}\e[0;39m"
  18. echo ""
  19. sleep 1
  20. echo "The installer will now detect and download the required files to allow ${gamename} server to run on a distro with less than GLIBC_${glibcversion}."
  21. echo "note: This will NOT upgrade GLIBC on your system."
  22. sleep 1
  23. echo ""
  24. echo "Downloading Required files"
  25. echo "================================="
  26. sleep 1
  27. }
  28. if [ -z $(command -v ldd) ]; then
  29. echo ""
  30. echo -e "\r\033[K\e[0;31mFAIL\e[0;39m GLIBC is not detected."
  31. sleep 1
  32. echo "Install GLIBC and retry installation"
  33. sleep 1
  34. echo ""
  35. while true; do
  36. read -p "Continue install? [y/N]" yn
  37. case $yn in
  38. [Yy]* ) break;;
  39. [Nn]* ) echo Exiting; exit;;
  40. * ) echo "Please answer yes or no.";;
  41. esac
  42. done
  43. elif [ "$(ldd --version | sed -n '1 p' | tr -cd [:digit:] | tail -c 3)" -lt 213 ]; then
  44. glibcversion="2.13"
  45. fn_glibcfixmsg
  46. # ARMA 3
  47. if [ "${gamename}" == "ARMA 3" ]; then
  48. cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
  49. # Just Cause 2
  50. elif [ "${gamename}" == "Just Cause 2" ]; then
  51. cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
  52. else
  53. echo "error: Unable to detect game. Fix not applied"
  54. fi
  55. sleep 1
  56. echo ""
  57. echo "GLIBC fix has been applied!"
  58. sleep 1
  59. echo ""
  60. elif [ "$(ldd --version | sed -n '1 p' | tr -cd [:digit:] | tail -c 3)" -lt 215 ]; then
  61. glibcversion="2.15"
  62. fn_glibcfixmsg
  63. # Blade Symphony
  64. if [ "${gamename}" == "Blade Symphony" ]; then
  65. cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
  66. # Fistful of Frags
  67. elif [ "${gamename}" == "Fistful of Frags" ]; then
  68. cd "${filesdir}"
  69. wget -nv -N --no-check-certificate https://github.com/dgibbs64/linuxgameservers/raw/master/FistfulOfFrags/dependencies/libm.so.6
  70. # Garrys's Mod
  71. elif [ "${gamename}" == "Garrys's Mod" ]; then
  72. cd "${filesdir}/bin"
  73. wget -nv -N --no-check-certificate https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libc.so.6
  74. wget -nv -N --no-check-certificate https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libm.so.6
  75. wget -nv -N --no-check-certificate https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libpthread.so.0
  76. cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
  77. # Insurgency
  78. elif [ "${gamename}" == "Insurgency" ]; then
  79. cd "${filesdir}/bin"
  80. wget -nv -N --no-check-certificate https://github.com/dgibbs64/linuxgameservers/raw/master/Insurgency/dependencies/libc.so.6
  81. wget -nv -N --no-check-certificate https://github.com/dgibbs64/linuxgameservers/raw/master/Insurgency/dependencies/librt.so.1
  82. wget -nv -N --no-check-certificate https://github.com/dgibbs64/linuxgameservers/raw/master/Insurgency/dependencies/libpthread.so.0
  83. # Natural Selection 2
  84. elif [ "${gamename}" == "Natural Selection 2" ]; then
  85. cd "${filesdir}"
  86. wget -nv -N --no-check-certificate https://github.com/dgibbs64/linuxgameservers/raw/master/NaturalSelection2/dependencies/libm.so.6
  87. cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
  88. # No More Room in Hell
  89. elif [ "${gamename}" == "No More Room in Hell" ]; then
  90. cd "${filesdir}"
  91. wget -nv -N --no-check-certificate https://github.com/dgibbs64/linuxgameservers/raw/master/NoMoreRoomInHell/dependencies/libm.so.6
  92. cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
  93. else
  94. echo "error: Unable to detect game. Fix not applied"
  95. fi
  96. sleep 1
  97. echo ""
  98. echo "GLIBC fix has been applied!"
  99. sleep 1
  100. echo ""
  101. fi